public double getPriority() { double left = _left.getPriority(); double right = _right.getPriority(); if (left < right) return(left); else return(right); }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final InstructionList il = methodGen.getInstructionList(); _left.translate(classGen, methodGen); final InstructionHandle gotot = il.append(new GOTO(null)); il.append(methodGen.loadContextNode()); _right.translate(classGen, methodGen); _left._trueList.backPatch(gotot); _left._falseList.backPatch(gotot.getNext()); _trueList.append(_right._trueList.add(gotot)); _falseList.append(_right._falseList); } }
p instanceof TopLevelElement) _left.translate(classGen, methodGen); local.setStart(storeInst); _left.translate(classGen, methodGen); _left.backPatchFalseList(ancestor.getLoopHandle()); // clears list
_from.translate(nodeCounterGen, matchGen); _from.synthesize(nodeCounterGen, matchGen); il.append(IRETURN); _count.translate(nodeCounterGen, matchGen); _count.synthesize(nodeCounterGen, matchGen);
/** * Return the highest priority for a pattern in this test * sequence. This is either the priority of the first or * of the default pattern. */ public double getPriority() { final Template template = (_patterns.size() == 0) ? _default : ((Pattern) _patterns.elementAt(0)).getTemplate(); return template.getPriority(); }
public AncestorPattern(Pattern left, RelativePathPattern right) { _left = left; (_right = right).setParent(this); if (left != null) { left.setParent(this); } }
public void display(int indent) { Util.println('\n'); indent(indent); if (_name != null) { indent(indent); Util.println("name = " + _name); } else if (_pattern != null) { indent(indent); Util.println("match = " + _pattern.toString()); } if (_mode != null) { indent(indent); Util.println("mode = " + _mode); } displayContents(indent + IndentIncrement); }
return; if (_match.isDummy()) { reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "match"); return;
il.append(loadLocal); _left.translate(classGen, methodGen); il.append(new GOTO(parent)); exit.setTarget(il.append(NOP)); _left.backPatchFalseList(_loop);
_match.translate(classGen, methodGen); _match.synthesize(classGen, methodGen); // Leaves 0 or 1 on stack final BranchHandle skipNode = il.append(new IFEQ(null));
public void setParser(Parser parser) { super.setParser(parser); if (_left != null) { _left.setParser(parser); } _right.setParser(parser); }
/** * Returns the position of the highest priority pattern in * this test sequence. */ public int getPosition() { final Template template = (_patterns.size() == 0) ? _default : ((Pattern) _patterns.elementAt(0)).getTemplate(); return template.getPosition(); }
public ParentPattern(Pattern left, RelativePathPattern right) { (_left = left).setParent(this); (_right = right).setParent(this); }
public void display(int indent) { Util.println('\n'); indent(indent); if (_name != null) { indent(indent); Util.println("name = " + _name); } else if (_pattern != null) { indent(indent); Util.println("match = " + _pattern.toString()); } if (_mode != null) { indent(indent); Util.println("mode = " + _mode); } displayContents(indent + IndentIncrement); }
return; if (_match.isDummy()) { reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "match"); return;
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_pattern != null) { _pattern.typeCheck(stable); } return typeCheckContents(stable); }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final InstructionList il = methodGen.getInstructionList(); _left.translate(classGen, methodGen); final InstructionHandle gotot = il.append(new GOTO(null)); il.append(methodGen.loadContextNode()); _right.translate(classGen, methodGen); _left._trueList.backPatch(gotot); _left._falseList.backPatch(gotot.getNext()); _trueList.append(_right._trueList.add(gotot)); _falseList.append(_right._falseList); } }
p instanceof TopLevelElement) _left.translate(classGen, methodGen); local.setStart(storeInst); _left.translate(classGen, methodGen); _left.backPatchFalseList(ancestor.getLoopHandle()); // clears list