/** * @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 hexFP() { return Sequence( FirstOf( Sequence(Ch('.'), OneOrMore(hexDigit())), Sequence( OneOrMore(hexDigit()), Optional(Sequence(Ch('.'), ZeroOrMore(hexDigit()))))), Sequence( CharIgnoreCase('p'), Optional(FirstOf(Ch('+'), Ch('-'))), OneOrMore(digit())), numberTypeSuffix()); }
/** * @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 hexFP() { return Sequence( FirstOf( Sequence(Ch('.'), OneOrMore(hexDigit())), Sequence( OneOrMore(hexDigit()), Optional(Sequence(Ch('.'), ZeroOrMore(hexDigit()))))), Sequence( CharIgnoreCase('p'), Optional(FirstOf(Ch('+'), Ch('-'))), OneOrMore(digit())), numberTypeSuffix()); }
/** * @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 hexFP() { return Sequence( FirstOf( Sequence(Ch('.'), OneOrMore(hexDigit())), Sequence( OneOrMore(hexDigit()), Optional(Sequence(Ch('.'), ZeroOrMore(hexDigit()))))), Sequence( CharIgnoreCase('p'), Optional(FirstOf(Ch('+'), Ch('-'))), OneOrMore(digit())), numberTypeSuffix()); }
/** * @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 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 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 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 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 hexLiteral() { return Sequence( Sequence( Sequence(Ch('0'), CharIgnoreCase('x')), FirstOf( hexFP(), Sequence(OneOrMore(hexDigit()), numberTypeSuffix()) )), set(actions.createNumberLiteral(lastText()))); }