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

Method rot_map

output/java8/1.4.15/Interpreter.java:783–808  ·  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

781 */
782
783 protected void rot_map(InstanceScope scope, Object attr, List<ST> prototypes) {
784 if ( attr==null ) {
785 operands[++sp] = null;
786 return;
787 }
788 attr = convertAnythingIteratableToIterator(scope, attr);
789 if ( attr instanceof Iterator ) {
790 List<ST> mapped = rot_map_iterator(scope, (Iterator)attr, prototypes);
791 operands[++sp] = mapped;
792 }
793 else { // if only single value, just apply first template to sole value
794 ST proto = prototypes.get(0);
795 ST st = group.createStringTemplateInternally(proto);
796 if ( st!=null ) {
797 setFirstArgument(scope, st, attr);
798 if ( st.impl.isAnonSubtemplate ) {
799 st.rawSetAttribute("i0", 0);
800 st.rawSetAttribute("i", 1);
801 }
802 operands[++sp] = st;
803 }
804 else {
805 operands[++sp] = null;
806 }
807 }
808 }
809
810 protected List<ST> rot_map_iterator(InstanceScope scope, Iterator<?> attr, List<ST> prototypes) {
811 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