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

Method rot_map

output/java8/1.4.14/Interpreter.java:779–804  ·  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

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