public Rule anyLiteral() { return FirstOf( nullLiteral(), booleanLiteral(), numberLiteral(), charLiteral(), stringLiteral()); }
public Rule anyLiteral() { return FirstOf( nullLiteral(), booleanLiteral(), numberLiteral(), charLiteral(), stringLiteral()); }
public Rule anyLiteral() { return FirstOf( nullLiteral(), booleanLiteral(), numberLiteral(), charLiteral(), stringLiteral()); }
Rule hexDigit() { return FirstOf(digit(), CharIgnoreCase('a'), CharIgnoreCase('b'), CharIgnoreCase('c'), CharIgnoreCase('d'), CharIgnoreCase('e'), CharIgnoreCase('f')); } }
Rule hexDigit() { return FirstOf(digit(), CharIgnoreCase('a'), CharIgnoreCase('b'), CharIgnoreCase('c'), CharIgnoreCase('d'), CharIgnoreCase('e'), CharIgnoreCase('f')); } }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.6">JLS section 3.10.6</a> */ Rule escapedSequence() { return Sequence(Ch('\\'), FirstOf( Sequence(Optional(zeroToThree()), octalDigit(), Optional(octalDigit())), Any())); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.6">JLS section 3.10.6</a> */ Rule escapedSequence() { return Sequence(Ch('\\'), FirstOf( Sequence(Optional(zeroToThree()), octalDigit(), Optional(octalDigit())), Any())); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.3">JLS section 3.10.3</a> */ public Rule booleanLiteral() { return Sequence( Sequence( FirstOf(String("true"), String("false")), group.basics.testLexBreak()), set(actions.createBooleanLiteral(lastText())), group.basics.optWS()); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.6">JLS section 3.10.6</a> */ Rule escapedSequence() { return Sequence(Ch('\\'), FirstOf( Sequence(Optional(zeroToThree()), octalDigit(), Optional(octalDigit())), Any())); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.3">JLS section 3.10.3</a> */ public Rule booleanLiteral() { return Sequence( Sequence( FirstOf(String("true"), String("false")), group.basics.testLexBreak()), set(actions.createBooleanLiteral(lastText())), group.basics.optWS()); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.3">JLS section 3.10.3</a> */ public Rule booleanLiteral() { return Sequence( Sequence( FirstOf(String("true"), String("false")), group.basics.testLexBreak()), set(actions.createBooleanLiteral(lastText())), group.basics.optWS()); }
@SuppressSubnodes Rule stringLiteralRaw() { return Sequence( Ch('"'), ZeroOrMore(FirstOf( stringEscape(), Sequence(TestNot(CharSet("\"\r\n")), Any()))), Ch('"')); }
@SuppressSubnodes Rule stringLiteralRaw() { return Sequence( Ch('"'), ZeroOrMore(FirstOf( stringEscape(), Sequence(TestNot(CharSet("\"\r\n")), Any()))), Ch('"')); }
@SuppressSubnodes Rule stringLiteralRaw() { return Sequence( Ch('"'), ZeroOrMore(FirstOf( stringEscape(), Sequence(TestNot(CharSet("\"\r\n")), Any()))), Ch('"')); }
Rule stringEscape() { return Sequence( Ch('\\'), FirstOf( Sequence(Optional(CharRange('0', '3')), Optional(CharRange('0', '7')), CharRange('0', '7')), Sequence(TestNot("\r\n"), Any()))); }
Rule stringEscape() { return Sequence( Ch('\\'), FirstOf( Sequence(Optional(CharRange('0', '3')), Optional(CharRange('0', '7')), CharRange('0', '7')), Sequence(TestNot("\r\n"), Any()))); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.1">JLS section 3.10.1</a> * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.2">JLS section 3.10.2</a> */ public Rule numberLiteral() { return Sequence( Test(Sequence(Optional(Ch('.')), CharRange('0', '9'))), FirstOf(hexLiteral(), fpLiteral()), set(lastValue()), group.basics.optWS()); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.1">JLS section 3.10.1</a> * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.2">JLS section 3.10.2</a> */ public Rule numberLiteral() { return Sequence( Test(Sequence(Optional(Ch('.')), CharRange('0', '9'))), FirstOf(hexLiteral(), fpLiteral()), set(lastValue()), group.basics.optWS()); }
Rule stringEscape() { return Sequence( Ch('\\'), FirstOf( Sequence(Optional(CharRange('0', '3')), Optional(CharRange('0', '7')), CharRange('0', '7')), Sequence(TestNot("\r\n"), Any()))); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.1">JLS section 3.10.1</a> * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.2">JLS section 3.10.2</a> */ public Rule numberLiteral() { return Sequence( Test(Sequence(Optional(Ch('.')), CharRange('0', '9'))), FirstOf(hexLiteral(), fpLiteral()), set(lastValue()), group.basics.optWS()); }