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

Method rot_map

output/java/1.4.19/Interpreter.java:815–840  ·  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

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