/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.5">JLS section 3.10.5</a> */ public Rule stringLiteral() { return Sequence( stringLiteralRaw(), set(actions.createStringLiteral(lastText())), group.basics.optWS()); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.5">JLS section 3.10.5</a> */ public Rule stringLiteral() { return Sequence( stringLiteralRaw(), set(actions.createStringLiteral(lastText())), group.basics.optWS()); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.5">JLS section 3.10.5</a> */ public Rule stringLiteral() { return Sequence( stringLiteralRaw(), set(actions.createStringLiteral(lastText())), group.basics.optWS()); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.7">JLS section 3.10.7</a> */ public Rule nullLiteral() { return Sequence( Sequence( String("null"), group.basics.testLexBreak()), set(actions.createNullLiteral(lastText())), group.basics.optWS()); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.7">JLS section 3.10.7</a> */ public Rule nullLiteral() { return Sequence( Sequence( String("null"), group.basics.testLexBreak()), set(actions.createNullLiteral(lastText())), group.basics.optWS()); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.7">JLS section 3.10.7</a> */ public Rule nullLiteral() { return Sequence( Sequence( String("null"), group.basics.testLexBreak()), set(actions.createNullLiteral(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()); }
/** * @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()); }
/** * @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()); }
/** * @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> */ Rule hexLiteral() { return Sequence( Sequence( Sequence(Ch('0'), CharIgnoreCase('x')), FirstOf( hexFP(), Sequence(OneOrMore(hexDigit()), numberTypeSuffix()) )), set(actions.createNumberLiteral(lastText()))); }
/** * @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> */ Rule hexLiteral() { return Sequence( Sequence( Sequence(Ch('0'), CharIgnoreCase('x')), FirstOf( hexFP(), Sequence(OneOrMore(hexDigit()), numberTypeSuffix()) )), set(actions.createNumberLiteral(lastText()))); }
/** * @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> */ Rule hexLiteral() { return Sequence( Sequence( Sequence(Ch('0'), CharIgnoreCase('x')), FirstOf( hexFP(), Sequence(OneOrMore(hexDigit()), numberTypeSuffix()) )), set(actions.createNumberLiteral(lastText()))); }
/** * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.4">JLS section 3.10.4</a> */ public Rule charLiteral() { return Sequence( Sequence( Ch('\''), FirstOf( Sequence(escapedSequence(), Ch('\'')), Sequence( ZeroOrMore(Sequence(TestNot( FirstOf(Ch('\''), group.basics.lineTerminator())), Any())), Ch('\'')), Any())), set(actions.createCharLiteral(lastText())), 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> */ Rule fpLiteral() { return Sequence( Sequence( FirstOf( Sequence(OneOrMore(digit()), Optional(Sequence(Ch('.'), ZeroOrMore(digit())))), Sequence(Ch('.'), OneOrMore(digit()))), Optional( Sequence( CharIgnoreCase('e'), Optional(FirstOf(Ch('+'), Ch('-'))), OneOrMore(digit()))), numberTypeSuffix()), set(actions.createNumberLiteral(lastText()))); }
/** * @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> */ Rule fpLiteral() { return Sequence( Sequence( FirstOf( Sequence(OneOrMore(digit()), Optional(Sequence(Ch('.'), ZeroOrMore(digit())))), Sequence(Ch('.'), OneOrMore(digit()))), Optional( Sequence( CharIgnoreCase('e'), Optional(FirstOf(Ch('+'), Ch('-'))), OneOrMore(digit()))), numberTypeSuffix()), set(actions.createNumberLiteral(lastText()))); }
/** * @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> */ Rule fpLiteral() { return Sequence( Sequence( FirstOf( Sequence(OneOrMore(digit()), Optional(Sequence(Ch('.'), ZeroOrMore(digit())))), Sequence(Ch('.'), OneOrMore(digit()))), Optional( Sequence( CharIgnoreCase('e'), Optional(FirstOf(Ch('+'), Ch('-'))), OneOrMore(digit()))), numberTypeSuffix()), set(actions.createNumberLiteral(lastText()))); }