/** * clef-line ::= "1" / "2" / "3" / "4" / "5" */ Rule ClefLine() { return FirstOf('1', '2', '3', '4', '5').label(ClefLine).suppressSubnodes(); } Rule ClefOctave() {
/** * VCHAR ::= %x21-7e * <p>printing chars */ Rule VCHAR() { return FirstOf(CharRange('!', '~'), LatinExtendedAndOtherAlphabet() ).label(VCHAR).suppressNode(); } /**
Rule IUnusedField() { return Sequence(String("["), AnyOf("EIJYabcdefghijklnopqrstvxyz") .label(UnusedFieldLetter).suppressSubnodes(), String(":"), ZeroOrMore(WSP()).suppressNode(), TexTextIfield(), String("]")) .label(IUnusedField); } /**
/** * x = invisible rest * * invisible-rest ::= %x78 */ Rule InvisibleRest() { return String("x").label(InvisibleRest); } /**
Rule StringLiteralSimple() { return Sequence( LITERAL_OPEN_SIMPLE, ZeroOrMore( FirstOf( EscapeSimple(), Sequence(TestNot(AnyOf("\r\n\\"+LITERAL_CLOSE_SIMPLE)), ANY) ) ).suppressSubnodes(), LITERAL_CLOSE_SIMPLE ); }
public Rule JsonObject() { return Sequence( ZeroOrMore( WhiteSpace() ).skipNode(), "{ ", FirstOf( Sequence( Pair(), ZeroOrMore( Sequence( ", ", Pair() ) ) ), Optional( Pair() ) ).suppressNode(), "} " ); }
public Rule skipNode() { if (target == null) { // if we have no target yet we need to save the marker and "apply" it later setNodeSkipped(true); return this; } // we already have a target to which we can directly apply the marker Rule inner = unwrap(target); target = (Matcher) inner.skipNode(); // since this might change the instance we have to update it setNodeSkipped(false); return target; }
/** Suppress node of r rule */ Rule suppr(Rule r) { return r.suppressNode(); } /** OneOrMore(DIGIT()), suppress sub nodes */
/** * CR ::= %x0D * <p>carriage return */ Rule CR() { return String("\r").label(CR); } /**
Rule StringLiteralDouble() { return Sequence( LITERAL_OPEN_DOUBLE, ZeroOrMore( FirstOf( EscapeDouble(), Sequence(TestNot(AnyOf("\r\n\\"+LITERAL_CLOSE_DOUBLE)), ANY) ) ).suppressSubnodes(), LITERAL_CLOSE_DOUBLE ); }
public Rule AggregateObject() { return Sequence( ZeroOrMore( WhiteSpace() ).skipNode(), "{ ", AggregatePair(), "} " ); }
public Rule suppressNode() { if (target == null) { // if we have no target yet we need to save the marker and "apply" it later setNodeSuppressed(true); return this; } // we already have a target to which we can directly apply the marker Rule inner = unwrap(target); target = (Matcher) inner.suppressNode(); // since this might change the instance we have to update it setNodeSuppressed(false); return target; }
/** * accidental ::= "^" / "^^" / "_" / "__" / "=" * * + quarter tones */ Rule Accidental() { //TODO Accidental : microtones return FirstOf("^^", "^/", "^", "__", "_/", "_", "=", "^3/2", "^3/", "_3/2", "_3/") .label(_Accidental).suppressSubnodes(); } /**
/** * xcom-multicol ::= "multicol" 1*WSP ("start" / "new" / "end") */ Rule XcomMulticol() { return Sequence("multicol", OneOrMore(WSP()).suppressNode(), FirstOf("start", "new", "end")) .label(XcomMulticol); } /**
public Rule compilationUnit() { return Sequence( group.basics.optWS(), Optional(packageDeclaration()).label("package"), ZeroOrMore(importDeclaration().label("import")).label("imports"), ZeroOrMore(anyTypeDeclaration().label("type")).label("types"), set(actions.createCompilationUnit(value("package"), values("imports/import"), values("types/type")))); } }
public Rule AggregateObject() { return Sequence( ZeroOrMore( WhiteSpace() ).skipNode(), "{ ", AggregatePair(), "} " ); }
/** * user definable symbols <tt>~, H-Y, h-w</tt> * * userdef-symbol ::= "~" / %x48-59 / %x68-77 */ Rule UserdefSymbol() { return AnyOf("~HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw") //return FirstOf('~', CharRange('H', 'Y'), CharRange('h','w')) .label(UserdefSymbol).suppressSubnodes(); } /**
/** * xcom-textline ::= "text" 1*WSP tex-text */ Rule XcomTextline() { return Sequence(String("text"), OneOrMore(WSP()).suppressNode(), TexText()) .label(XcomTextline); } /**
/** * P1 */ Rule level1ExpressionChaining() { return Sequence( primaryExpression().label("head"), set(), ZeroOrMore(FirstOf( arrayAccessOperation().label("arrayAccess"), methodInvocationWithTypeArgsOperation().label("methodInvocation"), select().label("select"))), set(actions.createLevel1Expression(node("head"), nodes("ZeroOrMore/FirstOf")))); }
/** * textblock-param ::= "obeylines" / ("fill" / "ragged") / ("align" / "justify") * / "skip" */ Rule TextblockParam() { return FirstOf("obeylines", "fill", "ragged", "align", "justify", "skip") .label(TextblockParam).suppressSubnodes(); } /**