MCPcopy Create free account
hub / github.com/antlr/codebuff / rot_map

Method rot_map

output/java/1.4.15/Interpreter.java:811–836  ·  view source on GitHub ↗

Renders expressions of the form or .

(InstanceScope scope, Object attr, List<ST> prototypes)

Source from the content-addressed store, hash-verified

809 */
810
811 protected void rot_map(InstanceScope scope, Object attr, List<ST> prototypes) {
812 if ( attr==null ) {
813 operands[++sp] = null;
814 return;
815 }
816 attr = convertAnythingIteratableToIterator(scope, attr);
817 if ( attr instanceof Iterator) {
818 List<ST> mapped = rot_map_iterator(scope, (Iterator)attr, prototypes);
819 operands[++sp] = mapped;
820 }
821 else { // if only single value, just apply first template to sole value
822 ST proto = prototypes.get(0);
823 ST st = group.createStringTemplateInternally(proto);
824 if ( st !=null ) {
825 setFirstArgument(scope, st, attr);
826 if ( st.impl.isAnonSubtemplate) {
827 st.rawSetAttribute("i0", 0);
828 st.rawSetAttribute("i", 1);
829 }
830 operands[++sp] = st;
831 }
832 else {
833 operands[++sp] = null;
834 }
835 }
836 }
837
838 protected List<ST> rot_map_iterator(InstanceScope scope, Iterator<?> attr, List<ST> prototypes) {
839 List<ST> mapped = new ArrayList<ST>();

Callers 2

_execMethod · 0.95
mapMethod · 0.95

Calls 6

rot_map_iteratorMethod · 0.95
setFirstArgumentMethod · 0.95
rawSetAttributeMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected