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

Method writeObjectWithOptions

output/java8/1.4.14/Interpreter.java:649–676  ·  view source on GitHub ↗

Write out an expression result that uses expression options. E.g.,

(STWriter out, InstanceScope scope, Object o, Object[] options)

Source from the content-addressed store, hash-verified

647 */
648
649 protected int writeObjectWithOptions(STWriter out, InstanceScope scope, Object o, Object[] options) {
650 int start = out.index(); // track char we're about to write
651 // precompute all option values (render all the way to strings)
652 String[] optionStrings = null;
653 if ( options!=null ) {
654 optionStrings = new String[options.length];
655 for (int i = 0; i < Compiler.NUM_OPTIONS; i++) {
656 optionStrings[i] = toString(out, scope, options[i]);
657 }
658 }
659 if ( options!=null && options[Option.ANCHOR.ordinal()] !=null ) {
660 out.pushAnchorPoint();
661 }
662
663 int n = writeObject(out, scope, o, optionStrings);
664 if ( options!=null && options[Option.ANCHOR.ordinal()] !=null ) {
665 out.popAnchorPoint();
666 }
667 if ( debug ) {
668 EvalExprEvent e = new EvalExprEvent(scope,
669 start,
670 out.index()-1,
671 getExprStartChar(scope),
672 getExprStopChar(scope));
673 trackDebugEvent(scope, e);
674 }
675 return n;
676 }
677
678 /** Generic method to emit text for an object. It differentiates
679 * between templates, iterable objects, and plain old Java objects (POJOs)

Callers 1

_execMethod · 0.95

Calls 9

toStringMethod · 0.95
writeObjectMethod · 0.95
getExprStartCharMethod · 0.95
getExprStopCharMethod · 0.95
trackDebugEventMethod · 0.95
indexMethod · 0.65
ordinalMethod · 0.65
pushAnchorPointMethod · 0.65
popAnchorPointMethod · 0.65

Tested by

no test coverage detected