MCPcopy Index your code
hub / github.com/antlr/codebuff / rot_map

Method rot_map

output/java/1.4.17/Interpreter.java:813–838  ·  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

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