You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2022/05/20 13:01:23 UTC
[jena] branch main updated: GH-1332: Update test parser to JavaCC 7.0 generation
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
The following commit(s) were added to refs/heads/main by this push:
new 99f4ec8630 GH-1332: Update test parser to JavaCC 7.0 generation
new b9bb95df79 Merge pull request #1333 from afs/core-ttl
99f4ec8630 is described below
commit 99f4ec8630e02436a3ee89d512024369326626c9
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Fri May 20 10:51:01 2022 +0100
GH-1332: Update test parser to JavaCC 7.0 generation
---
jena-core/Grammar/README | 6 +
jena-core/Grammar/turtle | 83 ---
jena-core/Grammar/turtle-parser | 59 ++
jena-core/Grammar/turtle-strict.jj | 543 ----------------
jena-core/Grammar/turtle.jj | 8 +-
.../jena/ttl/turtle/parser/JavaCharStream.java | 291 ++++++---
.../jena/ttl/turtle/parser/ParseException.java | 72 ++-
.../org/apache/jena/ttl/turtle/parser/Token.java | 11 +-
.../jena/ttl/turtle/parser/TokenMgrError.java | 41 +-
.../jena/ttl/turtle/parser/TurtleParser.java | 708 +++++++++++----------
.../ttl/turtle/parser/TurtleParserConstants.java | 2 +-
.../turtle/parser/TurtleParserTokenManager.java | 530 ++++++++-------
12 files changed, 1022 insertions(+), 1332 deletions(-)
diff --git a/jena-core/Grammar/README b/jena-core/Grammar/README
new file mode 100644
index 0000000000..a4540363e1
--- /dev/null
+++ b/jena-core/Grammar/README
@@ -0,0 +1,6 @@
+This is a Turtle parser used in support of jena-core tests.
+
+It is not compliant with RDF 1.1 Turtle.
+
+It is added to the jena-core RDFReaderFImpl so it is available in jena-core.
+It will be replaced if jena-arq is on the classpath by RIOT initialization.
diff --git a/jena-core/Grammar/turtle b/jena-core/Grammar/turtle
deleted file mode 100644
index 8fe37b04f7..0000000000
--- a/jena-core/Grammar/turtle
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/bash
-## Licensed to the Apache Software Foundation (ASF) under one
-## or more contributor license agreements. See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership. The ASF licenses this file
-## to you under the Apache License, Version 2.0 (the
-## "License"); you may not use this file except in compliance
-## with the License. You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-
-# Parser builder
-
-CLASS=Turtle
-DIR="../src/main/java/com/hp/hpl/jena/n3/turtle/parser"
-FILE=turtle.jj
-NAME=Turtle
-
-(cd "$DIR" ; rm TokenMgrError.java ParseException.java Token.java JavaCharStream.java )
-
-echo "---- Process grammar ----"
-## No it's now! echo "Warning about UNICODE_INPUT is ignorable"
-javacc -OUTPUT_DIRECTORY=$DIR -JDK_VERSION=1.5 "$FILE"
-RC=$?
-[ "$RC" = 0 ] || return
-echo "---- Create text form ----"
-jjdoc -TEXT=true -OUTPUT_FILE=${FILE%%.jj}.txt "${FILE}"
-
-## echo "---- Fixing Java warnings ---- "
-##
-##
-## F="$DIR/${CLASS}ParserTokenManager.java"
-## sed -e 's/import .*//' -e 's/MatchLoop: do/do/' < $F > F
-## mv F $F
-## rm -f F
-
- # Fix unnecessary imports
- echo "---- Fixing Java warnings in ${NAME}TokenManager ..."
-
- F="$DIR/${CLASS}ParserTokenManager.java"
-
- sed -e 's/import .*//' -e 's/MatchLoop: do/do/' \
- -e 's/int hiByte = (int)(curChar/int hiByte = (curChar/' \
- < $F > F
- mv F $F
-
- echo "---- Fixing Java warnings in ParseException ..."
- #Override:
- # public String getMessage()
- F="$DIR/ParseException.java"
- sed -e 's/@Override //' \
- -e 's/public String getMessage/@Override public String getMessage/' < $F > F
- mv F $F
-
- echo "---- Fixing Java warnings in Token ..."
- F="$DIR/Token.java"
- sed -e 's/@Override //' \
- -e 's/public String toString/@Override public String toString/' < $F > F
- mv F $F
-
- echo "---- Fixing Java warnings in TokenMgrError ..."
- # Override:
- # public String getMessage()
- F="$DIR/TokenMgrError.java"
- sed -e 's/@Override //' \
- -e 's/public String getMessage/@Override public String getMessage/' < $F > F
- mv F $F
-
- echo "---- Fixing Java warnings in ${CLASS}Parser ..."
- F="$DIR/${CLASS}Parser.java"
- sed -e 's/for (java.util.Iterator/for (java.util.Iterator<int[]>/' \
- -e 's/(int\[\])//' \
- -e 's/^\s*;\s*$//' \
- < $F > F
- mv F $F
-
- echo "---- Done"
diff --git a/jena-core/Grammar/turtle-parser b/jena-core/Grammar/turtle-parser
new file mode 100755
index 0000000000..d324868921
--- /dev/null
+++ b/jena-core/Grammar/turtle-parser
@@ -0,0 +1,59 @@
+#!/bin/bash
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements. See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership. The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+
+# Parser builder
+
+DIR="../src/main/java/org/apache/jena/ttl/turtle/parser"
+FILE=turtle.jj
+CLASS=TurtleParser
+
+(cd "$DIR" ; rm -f *.java )
+
+echo "---- Process grammar ----"
+
+javacc -OUTPUT_DIRECTORY=$DIR -JDK_VERSION=1.8 "$FILE"
+
+RC=$?
+[ "$RC" = 0 ] || return
+
+## echo "---- Create text form ----"
+## jjdoc -TEXT=true -OUTPUT_FILE=${FILE%%.jj}.txt "${FILE}"
+
+echo "---- Fixing Java warnings in TokenMgrError"
+F="$DIR/TokenMgrError.java"
+if [ -e "$F" ]
+then
+ sed -e 's/public class TokenMgrError/\n@SuppressWarnings("all")\npublic class TokenMgrError/' < $F > F
+ mv F $F
+fi
+
+## JavaCharStream -- SimpleCharStream is OK.
+echo "---- Fixing Java warnings in JavaCharStream..."
+F="$DIR/JavaCharStream.java"
+if [ -e "$F" ]
+then
+ sed -e 's/public/\n@SuppressWarnings("all")\npublic/' < $F > F
+ mv F $F
+fi
+
+echo "---- Fixing Java warnings in ${CLASS} ..."
+F="$DIR/${CLASS}.java"
+sed -e 's/@SuppressWarnings("serial")//' \
+ < $F > F
+mv F $F
+
+echo "---- Done"
diff --git a/jena-core/Grammar/turtle-strict.jj b/jena-core/Grammar/turtle-strict.jj
deleted file mode 100644
index 2fcba50ce4..0000000000
--- a/jena-core/Grammar/turtle-strict.jj
+++ /dev/null
@@ -1,543 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Turtle & N3 for Jena
-
-// N3 compatible:
-// Projection to Turtle is done by filtering non-Trutle forms.
-// A consequence is that where Turtle and N3 are incompatible (e.g.
-// whitespace processing) if follows N3.
-//
-// All legal Turtle documents are acceped by this grammar.
-
-options
-{
- // Use \ u escapes in streams AND use a reader for the query
- // => get both raw and escaped unicode
-
- JAVA_UNICODE_ESCAPE = true ;
- // We use a UTF-8 encoded stream anyway so the setting of
- // this is not important.
- // and it does not make any difference to the code generated!
- // One a warning is issued if true.
- UNICODE_INPUT = false ;
-
- STATIC = false ;
-// DEBUG_PARSER = true ;
-// DEBUG_TOKEN_MANAGER = true ;
-}
-
-PARSER_BEGIN(TurtleParser)
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.n3.turtle.parser ;
-
-import com.hp.hpl.jena.n3.turtle.ParserBase ;
-import com.hp.hpl.jena.graph.* ;
-
-public class TurtleParser extends ParserBase
-{
-}
-PARSER_END(TurtleParser)
-
-// --- Entry point
-
-void parse() : {}
-{
- (Statement())* <EOF>
-}
-
-void Statement() : {}
-{
- (Directive() | TriplesSameSubject() )
- <DOT>
-}
-
-void Directive() : { Token t ; Node n ; }
-{
- // Need a token for @prefix?
- // Looks like a LANTAG
- <PREFIX> t = <QNAME_NS> n = Q_IRI_REF()
- { String s = fixupPrefix(t.image, t.beginLine, t.beginColumn) ;
- setPrefix(t.beginLine, t.beginColumn, s, n.getURI()) ; }
-}
-
-// -------- PATH
-TOKEN:
-{
- < PLING: "!" >
- | < VBAR: "|" >
- | < CARROT: "^" >
- | < FPATH: "->" >
- | < RPATH: "<-" >
-
-}
-
-// N3
-
-// ---- TRIPLES
-// <<<<< SPARQL extract
-
-void TriplesSameSubject() : { Node s ; }
-{
- s = VarOrTerm()
- PropertyListNotEmpty(s)
-|
- // Any of the triple generating syntax elements
- s = TriplesNode()
- PropertyList(s)
-}
-
-
-void PropertyList(Node s) : { }
-{
- ( PropertyListNotEmpty(s) ) ?
-}
-// >>>>> SPARQL extract
-
-// Non-recursive for Turtle long PropertyList tests
-void PropertyListNotEmpty(Node s) : { Node p ; }
-{
- p = Verb()
- ObjectList(s, p)
- (<SEMICOLON> (p = Verb() ObjectList(s, p))? )*
-}
-
-// Non-recursive for Turtle long PropertyList tests
-void ObjectList(Node s, Node p): { Node o ; }
-{
- Object(s, p)
- ( <COMMA> Object(s, p) )*
-}
-
-void Object(Node s, Node p): { Node o ; }
-{
- o = GraphNode()
- { Triple t = new Triple(s,p,o) ;
- emitTriple(token.beginLine, token.beginColumn, t) ; }
-}
-
-// <<<<< SPARQL extract
-Node Verb() : {Node p ;}
-{
- ( p = IRIref() | <KW_A> { p = nRDFtype ; } |
- <ARROW>
- { p = nLogImplies ;
- if ( strictTurtle )
- raiseException("=> (log:implies) not legalin Turtle",
- token.beginLine, token.beginColumn ) ;
- }
- )
- { return p ; }
-}
-
-// -------- Triple expansions
-
-// Anything that can stand in a node slot and which is
-// a number of triples
-
-Node TriplesNode() : { Node n ; }
-{
- n = Collection() { return n ; }
- |
- n = BlankNodePropertyList() { return n ; }
-}
-
-Node BlankNodePropertyList() : { }
-{
- <LBRACKET>
- { Node n = createBNode() ; }
- PropertyListNotEmpty(n)
- <RBRACKET>
- { return n ; }
-}
-
-
-// ------- RDF collections
-
-// Code not as SPARQL/ARQ because of output ordering.
-Node Collection() :
- { Node listHead = nRDFnil ; Node lastCell = null ; Node n ; }
-{
- <LPAREN>
- (
- { Node cell = createBNode() ;
- if ( listHead == nRDFnil )
- listHead = cell ;
- if ( lastCell != null )
- emitTriple(token.beginLine, token.beginColumn,
- new Triple(lastCell, nRDFrest, cell)) ;
- }
- n = GraphNode()
- {
- emitTriple(token.beginLine, token.beginColumn,
- new Triple(cell, nRDFfirst, n)) ;
- lastCell = cell ;
- }
- ) +
- // Not * here - "()" is handled separately.
- <RPAREN>
- { if ( lastCell != null )
- emitTriple(token.beginLine, token.beginColumn,
- new Triple(lastCell, nRDFrest, nRDFnil)) ;
- return listHead ; }
-}
-
-// -------- Nodes in a graph pattern or template
-
-Node GraphNode() : { Node n ; }
-{
- n = VarOrTerm() { return n ; }
- |
- n = TriplesNode() { return n ; }
-}
-
-Node VarOrTerm() : {Node n = null ; }
-{
- ( n = Var() | n = GraphTerm() | n = Formula() )
- { return n ; }
-}
-
-Node Formula() : {Token t ; }
-{
- t = <LBRACE> { startFormula(t.beginLine, t.beginColumn) ; }
- // Need to sort this out and merge with Statement above
- TriplesSameSubject()
- ( <DOT> (TriplesSameSubject())? )*
- t = <RBRACE> { endFormula(t.beginLine, t.beginColumn) ; }
- { return null ; }
-}
-
-// >>>>> SPARQL extract
-
-Node Var() : { Token t ;}
-{
- ( t = <VAR1> | t = <VAR2> )
- { return createVariable(t.image, t.beginLine, t.beginColumn) ; }
-}
-
-Node GraphTerm() : { Node n ; }
-{
- n = IRIref() { return n ; }
-|
- n = RDFLiteral() { return n ; }
-|
- // Cleaner sign handling in Turtle.
- n = NumericLiteral() { return n ; }
-// |
-// n = BooleanLiteral() { return n ; }
-|
- n = BlankNode() { return n ; }
-|
-// <LPAREN> <RPAREN> { return nRDFnil ; }
- <NIL> { return nRDFnil ; }
-}
-// ---- Basic terms
-
-Node NumericLiteral() : { Token t ; }
-{
- t = <INTEGER> { return makeNodeInteger(t.image) ; }
-| t = <DECIMAL> { return makeNodeDecimal(t.image) ; }
-| t = <DOUBLE> { return makeNodeDouble(t.image) ; }
-}
-
-// >>>>> SPARQL extract
-// Langtag oddity.
-Node RDFLiteral() : { Token t ; String lex = null ; }
-{
- lex = String()
- // Optional lang tag and datatype.
- { String lang = null ; Node uri = null ; }
- (
- lang = Langtag()
- |
- ( <DATATYPE> uri = IRIref() )
- )?
- { return makeNode(lex, lang, uri) ; }
-}
-
-String Langtag() : { Token t ; }
-{
- // Enumerate the directives here
- ( t = <LANGTAG> | t = <PREFIX> )
- { String lang = stripChars(t.image, 1) ; return lang ; }
-}
-// >>>>> SPARQL extract
-// Node BooleanLiteral() : {}
-// {
-// <TRUE> { return XSD_TRUE ; }
-// |
-// <FALSE> { return XSD_FALSE ; }
-// }
-
-// <<<<< SPARQL extract
-
-String String() : { Token t ; String lex ; }
-{
- ( t = <STRING_LITERAL1> { lex = stripQuotes(t.image) ; }
- | t = <STRING_LITERAL2> { lex = stripQuotes(t.image) ; }
- | t = <STRING_LITERAL_LONG1> { lex = stripQuotes3(t.image) ; }
- | t = <STRING_LITERAL_LONG2> { lex = stripQuotes3(t.image) ; }
- )
- { lex = unescapeStr(lex, t.beginLine, t.beginColumn) ;
- return lex ;
- }
-}
-
-Node IRIref() : { Node n ; }
-{
- n = Q_IRI_REF() { return n ; }
-|
- n = QName() { return n ; }
-}
-
-Node QName() : { Token t ; }
-{
- ( t = <QNAME>
- { return createURIfromQName(t.image, t.beginLine, t.beginColumn) ; }
- |
- t = <QNAME_NS>
- { return createURIfromQName(t.image, t.beginLine, t.beginColumn) ; }
- )
-}
-
-Node BlankNode() : { Token t = null ; }
-{
- t = <BLANK_NODE_LABEL>
- { return createBNode(t.image, t.beginLine, t.beginColumn) ; }
-|
-// <LBRACKET> <RBRACKET> { return createBNode() ; }
- <ANON> { return createBNode() ; }
-
-}
-
-Node Q_IRI_REF() : { Token t ; }
-{
- t = <Q_IRIref>
- { return createNodeFromURI(t.image, t.beginLine, t.beginColumn) ; }
-}
-
-// ------------------------------------------
-// Tokens
-
-// Comments and whitespace
-
-SKIP : { " " | "\t" | "\n" | "\r" | "\f" }
-
-TOKEN: { <#WS: " " | "\t" | "\n" | "\r" | "\f"> }
-
-SPECIAL_TOKEN :
-{ <SINGLE_LINE_COMMENT: "#" (~["\n","\r"])* ("\n"|"\r"|"\r\n")? > }
-
-// -------------------------------------------------
-// Keyworks : directives before LANGTAG
-
-TOKEN : { <KW_A: "a" > } // Before HEX rule!
-
-TOKEN [IGNORE_CASE] :
-{
-// Prologue
- < PREFIX: "@prefix" >
-| < BASE: "@base" >
-
-//| < TRUE: "true" >
-//| < FALSE: "false" >
-}
-
-// -------------------------------------------------
-
-TOKEN :
-{
- < INTEGER: (["-","+"])? <DIGITS> >
-|
- < DECIMAL: (["-","+"])?
- ((<DIGITS>)+ "." (<DIGITS>)* | "." (<DIGITS>)+)
- >
- // Required exponent.
-| < DOUBLE:
- (["+","-"])?
- (
- (["0"-"9"])+ "." (["0"-"9"])* <EXPONENT>
- | "." (["0"-"9"])+ (<EXPONENT>)
- | (["0"-"9"])+ <EXPONENT>
- )
- >
- // Optional exponent.
-// | < DOUBLE:
-// //(["+","-"])?
-// (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)?
-// | "." (["0"-"9"])+ (<EXPONENT>)?
-// | (["0"-"9"])+ <EXPONENT>
-// >
-| < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
-| < #QUOTE_3D: "\"\"\"">
-| < #QUOTE_3S: "'''">
-
-// | <UCHAR: ("u" <HEX> <HEX> <HEX> <HEX> )
-// | ("U" <HEX> <HEX> <HEX> <HEX> <HEX> <HEX> <HEX> <HEX>)>
-
-// <ECHAR: ("t"|"b"|"n"|"r"|"f"|"\\"|"\""|"'")>
-//
-// |
-// <XCHAR: "\\" ( <ECHAR> | <UCHAR> ) >
-
-| <ECHAR: "\\" ("t"|"b"|"n"|"r"|"f"|"\\"|"\""|"'")>
-
-| < STRING_LITERAL1:
- // Single quoted string
- "'" ( (~["'","\\","\n","\r"]) | <ECHAR> )* "'" >
-
-| < STRING_LITERAL2:
- // Double quoted string
- "\"" ( (~["\"","\\","\n","\r"]) | <ECHAR> )* "\"" >
-
-| < STRING_LITERAL_LONG1:
- <QUOTE_3S>
- ( ~["'","\\"] | <ECHAR> | ("'" ~["'"]) | ("''" ~["'"]))*
- <QUOTE_3S> >
-
-| < STRING_LITERAL_LONG2:
- <QUOTE_3D>
- ( ~["\"","\\"] | <ECHAR> | ("\"" ~["\""]) | ("\"\"" ~["\""]))*
- <QUOTE_3D> >
-| < DIGITS: (["0"-"9"])+>
-| <HEX: ["0"-"9"] | ["A"-"F"] | ["a"-"f"]>
-}
-
-TOKEN:
-{
- // Includes # for relative URIs
- <Q_IRIref: "<" (~[">","<","\u0000"-"\u0020"])* ">" >
-
-| <QNAME_NS: (<NCNAME_PREFIX>)? ":" >
-| <QNAME: (<NCNAME_PREFIX>)? ":" (<NCNAME>)? >
-| <BLANK_NODE_LABEL: "_:" <NCNAME> >
-//| <BLANK_NODE_ID: "_!:" <NCNAME> >
-
-| <VAR1: <QMARK> <VARNAME> >
-| <VAR2: <DOLLAR> <VARNAME> >
-| <LANGTAG: <AT> (<A2Z>)+("-" (<A2ZN>)+)* >
-| <#A2Z: ["a"-"z","A"-"Z"]>
-| <#A2ZN: ["a"-"z","A"-"Z","0"-"9"]>
-}
-
-
-TOKEN :
-{
- < LPAREN: "(" >
-| < RPAREN: ")" >
-
-| <NIL: <LPAREN> (<WS>|<SINGLE_LINE_COMMENT>)* <RPAREN> >
-
-| < LBRACE: "{" >
-| < RBRACE: "}" >
-
-| < LBRACKET: "[" >
-| < RBRACKET: "]" >
-| < ANON: <LBRACKET> (<WS>|<SINGLE_LINE_COMMENT>)* <RBRACKET> >
-
-| < SEMICOLON: ";" >
-| < COMMA: "," >
-| < DOT: "." >
-}
-
-// Operator
-
-TOKEN :
-{
- < EQ: "=" >
-//| < NE: "!=" >
-//| < GT: ">" >
-//| < LT: "<" >
-//| < LE: "<=" > // Maybe: | "=>" >
-//| < GE: ">=" > // Maybe: | "=<" >
-
-| <ARROW: "=>">
-
-| < DOLLAR: "$">
-| < QMARK: "?">
-
-| < TILDE: "~" >
-| < COLON: ":" >
-
-// | < PLUS: "+" >
-// | < MINUS: "-" >
-| < STAR: "*" >
-| < SLASH: "/" >
-| < RSLASH: "\\" >
-
-//| < AMP: "&" >
-//| < REM: "%" >
-
-| < DATATYPE: "^^">
-| < AT: "@">
-}
-
-TOKEN:
-{
- // XML 1.1 NCNameStartChar without "_"
- <#NCCHAR1p:
- ["A"-"Z"] | ["a"-"z"] |
- ["\u00C0"-"\u00D6"] | ["\u00D8"-"\u00F6"] | ["\u00F8"-"\u02FF"] |
- ["\u0370"-"\u037D"] | ["\u037F"-"\u1FFF"] |
- ["\u200C"-"\u200D"] | ["\u2070"-"\u218F"] | ["\u2C00"-"\u2FEF"] |
- ["\u3001"-"\uD7FF"] | ["\uF900"-"\uFFFD"] >
- // [#x10000-#xEFFFF]
-|
- <#NCCHAR1: <NCCHAR1p> | "_" >
-
-// No trailing DOTs in qnames.
-|
- // #NCCHAR without "."
- <#NCCHAR: (<NCCHAR1> | "-" | ["0"-"9"] | "\u00B7" |
- ["\u0300"-"\u036F"] | ["\u203F"-"\u2040"] ) >
-|
- // NCNAME but no leading "_", no trailing ".", can have dot inside prefix name.
- <#NCNAME_PREFIX: <NCCHAR1p> ((<NCCHAR>|".")* <NCCHAR>)? >
-|
- // With a leading "_", no dot at end of local name.
- <#NCNAME: <NCCHAR1> ((<NCCHAR>|".")* <NCCHAR>)? >
-|
- // NCNAME without "-" and ".", allowing leading digits.
- <#VARNAME: ( <NCCHAR1> | ["0"-"9"] )
- ( <NCCHAR1> | ["0"-"9"] | "\u00B7" |
- ["\u0300"-"\u036F"] | ["\u203F"-"\u2040"] )* >
-}
-/*
-# Local Variables:
-# tab-width: 4
-# indent-tabs-mode: nil
-# comment-default-style: "//"
-# End:
-*/
diff --git a/jena-core/Grammar/turtle.jj b/jena-core/Grammar/turtle.jj
index a324e94115..aaeba4689b 100644
--- a/jena-core/Grammar/turtle.jj
+++ b/jena-core/Grammar/turtle.jj
@@ -54,12 +54,12 @@ PARSER_BEGIN(TurtleParser)
* limitations under the License.
*/
-package com.hp.hpl.jena.n3.turtle.parser ;
+package org.apache.jena.ttl.turtle.parser;
-import com.hp.hpl.jena.n3.turtle.ParserBase ;
-import com.hp.hpl.jena.graph.* ;
+import org.apache.jena.ttl.turtle.*;
+import org.apache.jena.graph.* ;
-public class TurtleParser extends ParserBase
+public class TurtleParser extends TurtleParserBase
{
}
PARSER_END(TurtleParser)
diff --git a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/JavaCharStream.java b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/JavaCharStream.java
index e0243db32d..176f970128 100644
--- a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/JavaCharStream.java
+++ b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/JavaCharStream.java
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 5.0 */
+/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 7.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,18 +18,22 @@
* limitations under the License.
*/
-package org.apache.jena.ttl.turtle.parser ;
+package org.apache.jena.ttl.turtle.parser;
/**
* An implementation of interface CharStream, where the stream is assumed to
* contain only ASCII characters (with java-like unicode escape processing).
*/
+
+@SuppressWarnings("all")
public
class JavaCharStream
{
/** Whether parser is static. */
- public static final boolean staticFlag = false;
+
+@SuppressWarnings("all")
+public static final boolean staticFlag = false;
static final int hexval(char c) throws java.io.IOException {
switch(c)
@@ -78,8 +82,10 @@ class JavaCharStream
throw new java.io.IOException(); // Should never come here
}
-/** Position in buffer. */
- public int bufpos = -1;
+/* Position in buffer. */
+
+@SuppressWarnings("all")
+public int bufpos = -1;
int bufsize;
int available;
int tokenBegin;
@@ -99,10 +105,15 @@ class JavaCharStream
protected int maxNextCharInd = 0;
protected int nextCharInd = -1;
protected int inBuf = 0;
- protected int tabSize = 8;
+ protected int tabSize = 1;
+ protected boolean trackLineColumn = true;
- protected void setTabSize(int i) { tabSize = i; }
- protected int getTabSize(int i) { return tabSize; }
+
+@SuppressWarnings("all")
+public void setTabSize(int i) { tabSize = i; }
+
+@SuppressWarnings("all")
+public int getTabSize() { return tabSize; }
protected void ExpandBuff(boolean wrapAround)
{
@@ -191,8 +202,10 @@ class JavaCharStream
return nextCharBuf[nextCharInd];
}
-/** @return starting character for token. */
- public char BeginToken() throws java.io.IOException
+/* @return starting character for token. */
+
+@SuppressWarnings("all")
+public char BeginToken() throws java.io.IOException
{
if (inBuf > 0)
{
@@ -271,8 +284,10 @@ class JavaCharStream
bufcolumn[bufpos] = column;
}
-/** Read a character. */
- public char readChar() throws java.io.IOException
+/* Read a character. */
+
+@SuppressWarnings("all")
+public char readChar() throws java.io.IOException
{
if (inBuf > 0)
{
@@ -291,7 +306,7 @@ class JavaCharStream
if ((buffer[bufpos] = c = ReadByte()) == '\\')
{
- UpdateLineColumn(c);
+ if (trackLineColumn) { UpdateLineColumn(c); }
int backSlashCnt = 1;
@@ -304,7 +319,7 @@ class JavaCharStream
{
if ((buffer[bufpos] = c = ReadByte()) != '\\')
{
- UpdateLineColumn(c);
+ if (trackLineColumn) { UpdateLineColumn(c); }
// found a non-backslash char.
if ((c == 'u') && ((backSlashCnt & 1) == 1))
{
@@ -327,7 +342,7 @@ class JavaCharStream
return '\\';
}
- UpdateLineColumn(c);
+ if (trackLineColumn) { UpdateLineColumn(c); }
backSlashCnt++;
}
@@ -365,54 +380,81 @@ class JavaCharStream
}
}
- @Deprecated
- /**
+ /*
* @deprecated
* @see #getEndColumn
*/
- public int getColumn() {
+ @Deprecated
+
+@SuppressWarnings("all")
+public int getColumn() {
return bufcolumn[bufpos];
}
- @Deprecated
- /**
+ /*
* @deprecated
* @see #getEndLine
+ * @return the line number.
*/
- public int getLine() {
+ @Deprecated
+
+@SuppressWarnings("all")
+public int getLine() {
return bufline[bufpos];
}
-/** Get end column. */
- public int getEndColumn() {
+/** Get end column.
+ * @return the end column or -1
+ */
+
+@SuppressWarnings("all")
+public int getEndColumn() {
return bufcolumn[bufpos];
}
-/** Get end line. */
- public int getEndLine() {
+/** Get end line.
+ * @return the end line number or -1
+ */
+
+@SuppressWarnings("all")
+public int getEndLine() {
return bufline[bufpos];
}
-/** @return column of token start */
- public int getBeginColumn() {
+/** Get the beginning column.
+ * @return column of token start */
+
+@SuppressWarnings("all")
+public int getBeginColumn() {
return bufcolumn[tokenBegin];
}
/** @return line number of token start */
- public int getBeginLine() {
+
+@SuppressWarnings("all")
+public int getBeginLine() {
return bufline[tokenBegin];
}
/** Retreat. */
- public void backup(int amount) {
+
+@SuppressWarnings("all")
+public void backup(int amount) {
inBuf += amount;
if ((bufpos -= amount) < 0)
bufpos += bufsize;
}
-/** Constructor. */
- public JavaCharStream(java.io.Reader dstream,
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ * @param buffersize size of the buffer
+ */
+
+@SuppressWarnings("all")
+public JavaCharStream(java.io.Reader dstream,
int startline, int startcolumn, int buffersize)
{
inputStream = dstream;
@@ -426,20 +468,33 @@ class JavaCharStream
nextCharBuf = new char[4096];
}
-/** Constructor. */
- public JavaCharStream(java.io.Reader dstream,
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ */
+
+@SuppressWarnings("all")
+public JavaCharStream(java.io.Reader dstream,
int startline, int startcolumn)
{
this(dstream, startline, startcolumn, 4096);
}
-/** Constructor. */
- public JavaCharStream(java.io.Reader dstream)
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ */
+
+@SuppressWarnings("all")
+public JavaCharStream(java.io.Reader dstream)
{
this(dstream, 1, 1, 4096);
}
-/** Reinitialise. */
- public void ReInit(java.io.Reader dstream,
+/* Reinitialise. */
+
+@SuppressWarnings("all")
+public void ReInit(java.io.Reader dstream,
int startline, int startcolumn, int buffersize)
{
inputStream = dstream;
@@ -459,97 +514,176 @@ class JavaCharStream
nextCharInd = bufpos = -1;
}
-/** Reinitialise. */
- public void ReInit(java.io.Reader dstream,
+/* Reinitialise. */
+
+@SuppressWarnings("all")
+public void ReInit(java.io.Reader dstream,
int startline, int startcolumn)
{
ReInit(dstream, startline, startcolumn, 4096);
}
-/** Reinitialise. */
- public void ReInit(java.io.Reader dstream)
+/* Reinitialise. */
+
+@SuppressWarnings("all")
+public void ReInit(java.io.Reader dstream)
{
ReInit(dstream, 1, 1, 4096);
}
/** Constructor. */
- public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
+
+@SuppressWarnings("all")
+public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
{
this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
}
-/** Constructor. */
- public JavaCharStream(java.io.InputStream dstream, int startline,
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ * @param buffersize size of the buffer
+ */
+
+@SuppressWarnings("all")
+public JavaCharStream(java.io.InputStream dstream, int startline,
int startcolumn, int buffersize)
{
- this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
}
-/** Constructor. */
- public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param encoding the character encoding of the data stream.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ * @throws UnsupportedEncodingException encoding is invalid or unsupported.
+ */
+
+@SuppressWarnings("all")
+public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
int startcolumn) throws java.io.UnsupportedEncodingException
{
this(dstream, encoding, startline, startcolumn, 4096);
}
-/** Constructor. */
- public JavaCharStream(java.io.InputStream dstream, int startline,
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ */
+
+@SuppressWarnings("all")
+public JavaCharStream(java.io.InputStream dstream, int startline,
int startcolumn)
{
this(dstream, startline, startcolumn, 4096);
}
-/** Constructor. */
- public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param encoding the character encoding of the data stream.
+ * @throws UnsupportedEncodingException encoding is invalid or unsupported.
+ */
+
+@SuppressWarnings("all")
+public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
{
this(dstream, encoding, 1, 1, 4096);
}
-/** Constructor. */
- public JavaCharStream(java.io.InputStream dstream)
+ /** Constructor.
+ * @param dstream the underlying data source.
+ */
+
+@SuppressWarnings("all")
+public JavaCharStream(java.io.InputStream dstream)
{
this(dstream, 1, 1, 4096);
}
-/** Reinitialise. */
- public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+/** Reinitialise.
+ * @param dstream the underlying data source.
+ * @param encoding the character encoding of the data stream.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ * @param buffersize size of the buffer
+ */
+
+@SuppressWarnings("all")
+public void ReInit(java.io.InputStream dstream, String encoding, int startline,
int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
{
ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
}
-/** Reinitialise. */
- public void ReInit(java.io.InputStream dstream, int startline,
+/** Reinitialise.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ * @param buffersize size of the buffer
+ */
+
+@SuppressWarnings("all")
+public void ReInit(java.io.InputStream dstream, int startline,
int startcolumn, int buffersize)
{
ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
}
-/** Reinitialise. */
- public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+/** Reinitialise.
+ * @param dstream the underlying data source.
+ * @param encoding the character encoding of the data stream.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ * @throws UnsupportedEncodingException encoding is invalid or unsupported.
+ */
+
+@SuppressWarnings("all")
+public void ReInit(java.io.InputStream dstream, String encoding, int startline,
int startcolumn) throws java.io.UnsupportedEncodingException
{
ReInit(dstream, encoding, startline, startcolumn, 4096);
}
-/** Reinitialise. */
- public void ReInit(java.io.InputStream dstream, int startline,
+/** Reinitialise.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ */
+
+@SuppressWarnings("all")
+public void ReInit(java.io.InputStream dstream, int startline,
int startcolumn)
{
ReInit(dstream, startline, startcolumn, 4096);
}
-/** Reinitialise. */
- public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+/** Reinitialise.
+ * @param dstream the underlying data source.
+ * @param encoding the character encoding of the data stream.
+ * @throws UnsupportedEncodingException encoding is invalid or unsupported.
+ */
+
+@SuppressWarnings("all")
+public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
{
ReInit(dstream, encoding, 1, 1, 4096);
}
-/** Reinitialise. */
- public void ReInit(java.io.InputStream dstream)
+/** Reinitialise.
+ * @param dstream the underlying data source.
+ */
+
+@SuppressWarnings("all")
+public void ReInit(java.io.InputStream dstream)
{
ReInit(dstream, 1, 1, 4096);
}
- /** @return token image as String */
- public String GetImage()
+ /** Get the token timage.
+ * @return token image as String */
+
+@SuppressWarnings("all")
+public String GetImage()
{
if (bufpos >= tokenBegin)
return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
@@ -558,8 +692,12 @@ class JavaCharStream
new String(buffer, 0, bufpos + 1);
}
- /** @return suffix */
- public char[] GetSuffix(int len)
+ /** Get the suffix as an array of characters.
+ * @param len the length of the array to return.
+ * @return suffix */
+
+@SuppressWarnings("all")
+public char[] GetSuffix(int len)
{
char[] ret = new char[len];
@@ -576,7 +714,9 @@ class JavaCharStream
}
/** Set buffers back to null when finished. */
- public void Done()
+
+@SuppressWarnings("all")
+public void Done()
{
nextCharBuf = null;
buffer = null;
@@ -586,8 +726,13 @@ class JavaCharStream
/**
* Method to adjust line and column numbers for the start of a token.
+ *
+ * @param newLine the new line number.
+ * @param newCol the new column number.
*/
- public void adjustBeginLineColumn(int newLine, int newCol)
+
+@SuppressWarnings("all")
+public void adjustBeginLineColumn(int newLine, int newCol)
{
int start = tokenBegin;
int len;
@@ -630,6 +775,8 @@ class JavaCharStream
line = bufline[j];
column = bufcolumn[j];
}
+ boolean getTrackLineColumn() { return trackLineColumn; }
+ void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; }
}
-/* JavaCC - OriginalChecksum=0cdbaa20861868d03ec70b2f127a4d76 (do not edit this line) */
+/* JavaCC - OriginalChecksum=932c0f047fc42f112a9b58627aff6634 (do not edit this line) */
diff --git a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/ParseException.java b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/ParseException.java
index afb1491f22..df4f90748c 100644
--- a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/ParseException.java
+++ b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/ParseException.java
@@ -1,5 +1,5 @@
-/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
-/* JavaCCOptions:KEEP_LINE_COL=null */
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 7.0 */
+/* JavaCCOptions:KEEP_LINE_COLUMN=true */
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,7 +18,7 @@
* limitations under the License.
*/
-package org.apache.jena.ttl.turtle.parser ;
+package org.apache.jena.ttl.turtle.parser;
/**
* This exception is thrown when parse errors are encountered.
@@ -38,6 +38,11 @@ public class ParseException extends Exception {
*/
private static final long serialVersionUID = 1L;
+ /**
+ * The end of line string for this machine.
+ */
+ protected static String EOL = System.getProperty("line.separator", "\n");
+
/**
* This constructor is used by the method "generateParseException"
* in the generated parser. Calling this constructor generates
@@ -78,7 +83,7 @@ public class ParseException extends Exception {
/**
* This is the last token that has been consumed successfully. If
* this object has been created due to a parse error, the token
- * followng this token will (therefore) be the first error token.
+ * following this token will (therefore) be the first error token.
*/
public Token currentToken;
@@ -106,25 +111,21 @@ public class ParseException extends Exception {
private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
- String eol = System.getProperty("line.separator", "\n");
+
StringBuilder expected = new StringBuilder();
int maxSize = 0;
- for ( int[] expectedTokenSequence : expectedTokenSequences )
- {
- if ( maxSize < expectedTokenSequence.length )
- {
- maxSize = expectedTokenSequence.length;
- }
- for ( int anExpectedTokenSequence : expectedTokenSequence )
- {
- expected.append( tokenImage[anExpectedTokenSequence] ).append( ' ' );
- }
- if ( expectedTokenSequence[expectedTokenSequence.length - 1] != 0 )
- {
- expected.append( "..." );
- }
- expected.append( eol ).append( " " );
+ for (int i = 0; i < expectedTokenSequences.length; i++) {
+ if (maxSize < expectedTokenSequences[i].length) {
+ maxSize = expectedTokenSequences[i].length;
+ }
+ for (int j = 0; j < expectedTokenSequences[i].length; j++) {
+ expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');
+ }
+ if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
+ expected.append("...");
}
+ expected.append(EOL).append(" ");
+ }
String retval = "Encountered \"";
Token tok = currentToken.next;
for (int i = 0; i < maxSize; i++) {
@@ -139,21 +140,26 @@ public class ParseException extends Exception {
retval += " \"";
tok = tok.next;
}
- retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
- retval += "." + eol;
- if (expectedTokenSequences.length == 1) {
- retval += "Was expecting:" + eol + " ";
+ if (currentToken.next != null) {
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+ }
+ retval += "." + EOL;
+
+
+ if (expectedTokenSequences.length == 0) {
+ // Nothing to add here
} else {
- retval += "Was expecting one of:" + eol + " ";
+ if (expectedTokenSequences.length == 1) {
+ retval += "Was expecting:" + EOL + " ";
+ } else {
+ retval += "Was expecting one of:" + EOL + " ";
+ }
+ retval += expected.toString();
}
- retval += expected.toString();
+
return retval;
}
- /**
- * The end of line string for this machine.
- */
- protected String eol = System.getProperty("line.separator", "\n");
/**
* Used to convert raw characters to their escaped version
@@ -161,13 +167,11 @@ public class ParseException extends Exception {
* string literal.
*/
static String add_escapes(String str) {
- StringBuffer retval = new StringBuffer();
+ StringBuilder retval = new StringBuilder();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
{
- case 0 :
- continue;
case '\b':
retval.append("\\b");
continue;
@@ -206,4 +210,4 @@ public class ParseException extends Exception {
}
}
-/* JavaCC - OriginalChecksum=1445cfbdb07eac90c2fe78625ed402b9 (do not edit this line) */
+/* JavaCC - OriginalChecksum=ecd3464b87732582c6aa01912829856c (do not edit this line) */
diff --git a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/Token.java b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/Token.java
index 23ee50509c..3462a0c815 100644
--- a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/Token.java
+++ b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/Token.java
@@ -1,5 +1,5 @@
-/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */
-/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 7.0 */
+/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COLUMN=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,7 +18,7 @@
* limitations under the License.
*/
-package org.apache.jena.ttl.turtle.parser ;
+package org.apache.jena.ttl.turtle.parser;
/**
* Describes the input token stream.
@@ -115,7 +115,8 @@ public class Token implements java.io.Serializable {
/**
* Returns the image.
*/
- @Override public String toString()
+ @Override
+ public String toString()
{
return image;
}
@@ -146,4 +147,4 @@ public class Token implements java.io.Serializable {
}
}
-/* JavaCC - OriginalChecksum=9021a6aba83c44e4f8638ea56a9cd5e5 (do not edit this line) */
+/* JavaCC - OriginalChecksum=b7752bd299ace9b496b80e3041bb8e31 (do not edit this line) */
diff --git a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TokenMgrError.java b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TokenMgrError.java
index d94406d577..dba876bad8 100644
--- a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TokenMgrError.java
+++ b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TokenMgrError.java
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 7.0 */
/* JavaCCOptions: */
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,9 +18,11 @@
* limitations under the License.
*/
-package org.apache.jena.ttl.turtle.parser ;
+package org.apache.jena.ttl.turtle.parser;
/** Token Manager Error. */
+
+@SuppressWarnings("all")
public class TokenMgrError extends Error
{
@@ -38,22 +40,22 @@ public class TokenMgrError extends Error
/**
* Lexical error occurred.
*/
- static final int LEXICAL_ERROR = 0;
+ public static final int LEXICAL_ERROR = 0;
/**
* An attempt was made to create a second instance of a static token manager.
*/
- static final int STATIC_LEXER_ERROR = 1;
+ public static final int STATIC_LEXER_ERROR = 1;
/**
* Tried to change to an invalid lexical state.
*/
- static final int INVALID_LEXICAL_STATE = 2;
+ public static final int INVALID_LEXICAL_STATE = 2;
/**
* Detected (and bailed out of) an infinite loop in the token manager.
*/
- static final int LOOP_DETECTED = 3;
+ public static final int LOOP_DETECTED = 3;
/**
* Indicates the reason why the exception is thrown. It will have
@@ -71,8 +73,6 @@ public class TokenMgrError extends Error
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
{
- case 0 :
- continue;
case '\b':
retval.append("\\b");
continue;
@@ -115,19 +115,21 @@ public class TokenMgrError extends Error
* token manager to indicate a lexical error.
* Parameters :
* EOFSeen : indicates if EOF caused the lexical error
- * curLexState : lexical state in which this error occurred
+ * lexState : lexical state in which this error occurred
* errorLine : line number when the error occurred
* errorColumn : column number when the error occurred
* errorAfter : prefix that was seen before this error occurred
* curchar : the offending character
* Note: You can customize the lexical error message by modifying this method.
*/
- protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
- return("Lexical error at line " +
- errorLine + ", column " +
- errorColumn + ". Encountered: " +
- (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
- "after : \"" + addEscapes(errorAfter) + "\"");
+ protected static String LexicalErr(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar) {
+ char curChar1 = (char)curChar;
+ return("Lexical error at line " + //
+ errorLine + ", column " + //
+ errorColumn + ". Encountered: " + //
+ (EOFSeen ? "<EOF>" : ("'" + addEscapes(String.valueOf(curChar)) + "' (" + (int)curChar + "),")) + //
+ (errorAfter == null || errorAfter.length() == 0 ? "" : " after prefix \"" + addEscapes(errorAfter) + "\"")) + //
+ (lexState == 0 ? "" : " (in lexical state " + lexState + ")");
}
/**
@@ -139,7 +141,8 @@ public class TokenMgrError extends Error
*
* from this method for such cases in the release version of your parser.
*/
- @Override public String getMessage() {
+ @Override
+ public String getMessage() {
return super.getMessage();
}
@@ -158,8 +161,8 @@ public class TokenMgrError extends Error
}
/** Full Constructor. */
- public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
- this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar, int reason) {
+ this(LexicalErr(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
}
}
-/* JavaCC - OriginalChecksum=ef795e5dfc5596c771c19f3fa22b9830 (do not edit this line) */
+/* JavaCC - OriginalChecksum=736a7f2dfde55835f349bdb3205f2740 (do not edit this line) */
diff --git a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TurtleParser.java b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TurtleParser.java
index 25a821378b..dad0d1ec83 100644
--- a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TurtleParser.java
+++ b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TurtleParser.java
@@ -1,3 +1,4 @@
+/* TurtleParser.java */
/* Generated By:JavaCC: Do not edit this line. TurtleParser.java */
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -17,26 +18,28 @@
* limitations under the License.
*/
-package org.apache.jena.ttl.turtle.parser ;
+package org.apache.jena.ttl.turtle.parser;
+import org.apache.jena.ttl.turtle.*;
import org.apache.jena.graph.* ;
-import org.apache.jena.ttl.turtle.TurtleParserBase;
public class TurtleParser extends TurtleParserBase implements TurtleParserConstants {
// --- Entry point
- final public void parse() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOM:
+ final public
+void parse() throws ParseException {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case BOM:{
jj_consume_token(BOM);
break;
+ }
default:
jj_la1[0] = jj_gen;
-
+ ;
}
label_1:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case PREFIX:
case BASE:
case TRUE:
@@ -57,9 +60,10 @@ public class TurtleParser extends TurtleParserBase implements TurtleParserConsta
case NIL:
case LBRACE:
case LBRACKET:
- case ANON:
-
+ case ANON:{
+ ;
break;
+ }
default:
jj_la1[1] = jj_gen;
break label_1;
@@ -67,14 +71,15 @@ public class TurtleParser extends TurtleParserBase implements TurtleParserConsta
Statement();
}
jj_consume_token(0);
- }
+}
final public void Statement() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case PREFIX:
- case BASE:
+ case BASE:{
Directive();
break;
+ }
case TRUE:
case FALSE:
case INTEGER:
@@ -93,43 +98,45 @@ public class TurtleParser extends TurtleParserBase implements TurtleParserConsta
case NIL:
case LBRACE:
case LBRACKET:
- case ANON:
+ case ANON:{
TriplesSameSubject();
break;
+ }
default:
jj_la1[2] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
jj_consume_token(DOT);
- }
+}
- final public void Directive() throws ParseException {
- Token t ; String iri ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PREFIX:
+ final public void Directive() throws ParseException {Token t ; String iri ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case PREFIX:{
jj_consume_token(PREFIX);
t = jj_consume_token(PNAME_NS);
iri = IRI_REF();
- String s = fixupPrefix(t.image, t.beginLine, t.beginColumn) ;
+String s = fixupPrefix(t.image, t.beginLine, t.beginColumn) ;
setPrefix(t.beginLine, t.beginColumn, s, iri) ;
break;
- case BASE:
+ }
+ case BASE:{
t = jj_consume_token(BASE);
iri = IRI_REF();
- setBase(iri, t.beginLine, t.beginColumn) ;
+setBase(iri, t.beginLine, t.beginColumn) ;
break;
+ }
default:
jj_la1[3] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- }
+}
// ---- TRIPLES
- final public void TriplesSameSubject() throws ParseException {
- Node s ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public
+void TriplesSameSubject() throws ParseException {Node s ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case TRUE:
case FALSE:
case INTEGER:
@@ -146,82 +153,86 @@ public class TurtleParser extends TurtleParserBase implements TurtleParserConsta
case VAR:
case NIL:
case LBRACE:
- case ANON:
+ case ANON:{
s = VarOrTerm();
PropertyListNotEmpty(s);
break;
+ }
case LPAREN:
- case LBRACKET:
+ case LBRACKET:{
// Any of the triple generating syntax elements
s = TriplesNode();
PropertyList(s);
break;
+ }
default:
jj_la1[4] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- }
+}
final public void PropertyList(Node s) throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case KW_A:
case IRIref:
case PNAME_NS:
case PNAME_LN:
case EQ:
- case ARROW:
+ case ARROW:{
PropertyListNotEmpty(s);
break;
+ }
default:
jj_la1[5] = jj_gen;
-
+ ;
}
- }
+}
// Non-recursive for Turtle long PropertyList tests
- final public void PropertyListNotEmpty(Node s) throws ParseException {
- Node p ;
+ final public void PropertyListNotEmpty(Node s) throws ParseException {Node p ;
p = Verb();
ObjectList(s, p);
label_2:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SEMICOLON:
-
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SEMICOLON:{
+ ;
break;
+ }
default:
jj_la1[6] = jj_gen;
break label_2;
}
jj_consume_token(SEMICOLON);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case KW_A:
case IRIref:
case PNAME_NS:
case PNAME_LN:
case EQ:
- case ARROW:
+ case ARROW:{
p = Verb();
ObjectList(s, p);
break;
+ }
default:
jj_la1[7] = jj_gen;
-
+ ;
}
}
- }
+}
// Non-recursive for Turtle long PropertyList tests
- final public void ObjectList(Node s, Node p) throws ParseException {
-
- Object(s, p);
+ final public void ObjectList(Node s, Node p) throws ParseException {Node o ;
+ Object(s, p);
label_3:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
-
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
+ ;
break;
+ }
default:
jj_la1[8] = jj_gen;
break label_3;
@@ -229,102 +240,105 @@ public class TurtleParser extends TurtleParserBase implements TurtleParserConsta
jj_consume_token(COMMA);
Object(s, p);
}
- }
+}
- final public void Object(Node s, Node p) throws ParseException {
- Node o ;
+ final public void Object(Node s, Node p) throws ParseException {Node o ;
o = GraphNode();
- Triple t = new Triple(s,p,o) ;
+Triple t = new Triple(s,p,o) ;
emitTriple(token.beginLine, token.beginColumn, t) ;
- }
+}
- final public Node Verb() throws ParseException {
- Node p ; String iri ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Node Verb() throws ParseException {Node p ; String iri ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
iri = IRIref();
- p = createNode(iri) ;
+p = createNode(iri) ;
break;
- case KW_A:
+ }
+ case KW_A:{
jj_consume_token(KW_A);
- p = nRDFtype ;
+p = nRDFtype ;
break;
- case EQ:
+ }
+ case EQ:{
jj_consume_token(EQ);
- p = nOwlSameAs ;
+p = nOwlSameAs ;
if ( strictTurtle )
throwParseException("= (owl:sameAs) not legal in Turtle",
token.beginLine, token.beginColumn ) ;
break;
- case ARROW:
+ }
+ case ARROW:{
jj_consume_token(ARROW);
- p = nLogImplies ;
+p = nLogImplies ;
if ( strictTurtle )
throwParseException("=> (log:implies) not legal in Turtle",
token.beginLine, token.beginColumn ) ;
break;
+ }
default:
jj_la1[9] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return p ;}
+{if ("" != null) return p ;}
throw new Error("Missing return statement in function");
- }
+}
// -------- Triple expansions
// Anything that can stand in a node slot and which is
// a number of triples
- final public Node TriplesNode() throws ParseException {
- Node n ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
+ final public
+Node TriplesNode() throws ParseException {Node n ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LPAREN:{
n = Collection();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
- case LBRACKET:
+ }
+ case LBRACKET:{
n = BlankNodePropertyList();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
default:
jj_la1[10] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
final public Node BlankNodePropertyList() throws ParseException {
jj_consume_token(LBRACKET);
- Node n = createBNode() ;
+Node n = createBNode() ;
PropertyListNotEmpty(n);
jj_consume_token(RBRACKET);
- {if (true) return n ;}
+{if ("" != null) return n ;}
throw new Error("Missing return statement in function");
- }
+}
// ------- RDF collections
// Code not as SPARQL/ARQ because of output ordering.
- final public Node Collection() throws ParseException {
- Node listHead = nRDFnil ; Node lastCell = null ; Node n ;
+ final public Node Collection() throws ParseException {Node listHead = nRDFnil ; Node lastCell = null ; Node n ;
jj_consume_token(LPAREN);
label_4:
while (true) {
- Node cell = createBNode() ;
+Node cell = createBNode() ;
if ( listHead == nRDFnil )
listHead = cell ;
if ( lastCell != null )
emitTriple(token.beginLine, token.beginColumn,
new Triple(lastCell, nRDFrest, cell)) ;
n = GraphNode();
- emitTriple(token.beginLine, token.beginColumn,
+emitTriple(token.beginLine, token.beginColumn,
new Triple(cell, nRDFfirst, n)) ;
lastCell = cell ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case TRUE:
case FALSE:
case INTEGER:
@@ -343,26 +357,27 @@ public class TurtleParser extends TurtleParserBase implements TurtleParserConsta
case NIL:
case LBRACE:
case LBRACKET:
- case ANON:
-
+ case ANON:{
+ ;
break;
+ }
default:
jj_la1[11] = jj_gen;
break label_4;
}
}
jj_consume_token(RPAREN);
- if ( lastCell != null )
+if ( lastCell != null )
emitTriple(token.beginLine, token.beginColumn,
new Triple(lastCell, nRDFrest, nRDFnil)) ;
- {if (true) return listHead ;}
+ {if ("" != null) return listHead ;}
throw new Error("Missing return statement in function");
- }
+}
// -------- Nodes in a graph pattern or template
- final public Node GraphNode() throws ParseException {
- Node n ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public
+Node GraphNode() throws ParseException {Node n ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case TRUE:
case FALSE:
case INTEGER:
@@ -379,29 +394,31 @@ public class TurtleParser extends TurtleParserBase implements TurtleParserConsta
case VAR:
case NIL:
case LBRACE:
- case ANON:
+ case ANON:{
n = VarOrTerm();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case LPAREN:
- case LBRACKET:
+ case LBRACKET:{
n = TriplesNode();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
default:
jj_la1[12] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Node VarOrTerm() throws ParseException {
- Node n = null ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case VAR:
+ final public Node VarOrTerm() throws ParseException {Node n = null ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case VAR:{
n = Var();
break;
+ }
case TRUE:
case FALSE:
case INTEGER:
@@ -416,38 +433,40 @@ public class TurtleParser extends TurtleParserBase implements TurtleParserConsta
case PNAME_LN:
case BLANK_NODE_LABEL:
case NIL:
- case ANON:
+ case ANON:{
n = GraphTerm();
break;
- case LBRACE:
+ }
+ case LBRACE:{
n = Formula();
break;
+ }
default:
jj_la1[13] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return n ;}
+{if ("" != null) return n ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node Formula() throws ParseException {
- Token t ;
+ final public Node Formula() throws ParseException {Token t ;
t = jj_consume_token(LBRACE);
- startFormula(t.beginLine, t.beginColumn) ;
+startFormula(t.beginLine, t.beginColumn) ;
TriplesSameSubject();
label_5:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DOT:
-
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case DOT:{
+ ;
break;
+ }
default:
jj_la1[14] = jj_gen;
break label_5;
}
jj_consume_token(DOT);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case TRUE:
case FALSE:
case INTEGER:
@@ -466,278 +485,296 @@ public class TurtleParser extends TurtleParserBase implements TurtleParserConsta
case NIL:
case LBRACE:
case LBRACKET:
- case ANON:
+ case ANON:{
TriplesSameSubject();
break;
+ }
default:
jj_la1[15] = jj_gen;
-
+ ;
}
}
t = jj_consume_token(RBRACE);
- endFormula(t.beginLine, t.beginColumn) ;
- {if (true) return null ;}
+endFormula(t.beginLine, t.beginColumn) ;
+{if ("" != null) return null ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node Var() throws ParseException {
- Token t ;
+ final public Node Var() throws ParseException {Token t ;
t = jj_consume_token(VAR);
- {if (true) return createVariable(t.image, t.beginLine, t.beginColumn) ;}
+{if ("" != null) return createVariable(t.image, t.beginLine, t.beginColumn) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node GraphTerm() throws ParseException {
- Node n ; String iri ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Node GraphTerm() throws ParseException {Node n ; String iri ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
iri = IRIref();
- {if (true) return createNode(iri) ;}
+{if ("" != null) return createNode(iri) ;}
break;
+ }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:
+ case STRING_LITERAL_LONG2:{
n = RDFLiteral();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case INTEGER:
case DECIMAL:
- case DOUBLE:
+ case DOUBLE:{
// Cleaner sign handling in Turtle.
n = NumericLiteral();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case TRUE:
- case FALSE:
+ case FALSE:{
n = BooleanLiteral();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case BLANK_NODE_LABEL:
- case ANON:
+ case ANON:{
n = BlankNode();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
- case NIL:
+ }
+ case NIL:{
jj_consume_token(NIL);
- {if (true) return nRDFnil ;}
+{if ("" != null) return nRDFnil ;}
break;
+ }
default:
jj_la1[16] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
// ---- Basic terms
- final public Node NumericLiteral() throws ParseException {
- Token t ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INTEGER:
+ final public
+Node NumericLiteral() throws ParseException {Token t ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case INTEGER:{
t = jj_consume_token(INTEGER);
- {if (true) return createLiteralInteger(t.image) ;}
+{if ("" != null) return createLiteralInteger(t.image) ;}
break;
- case DECIMAL:
+ }
+ case DECIMAL:{
t = jj_consume_token(DECIMAL);
- {if (true) return createLiteralDecimal(t.image) ;}
+{if ("" != null) return createLiteralDecimal(t.image) ;}
break;
- case DOUBLE:
+ }
+ case DOUBLE:{
t = jj_consume_token(DOUBLE);
- {if (true) return createLiteralDouble(t.image) ;}
+{if ("" != null) return createLiteralDouble(t.image) ;}
break;
+ }
default:
jj_la1[17] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Node RDFLiteral() throws ParseException {
-
- String lex = null ;
+ final public Node RDFLiteral() throws ParseException {Token t ; String lex = null ;
lex = String();
- String lang = null ; String dt = null ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+String lang = null ; String dt = null ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case PREFIX:
case BASE:
case LANGTAG:
- case DATATYPE:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case DATATYPE:{
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case PREFIX:
case BASE:
- case LANGTAG:
+ case LANGTAG:{
lang = Langtag();
break;
- case DATATYPE:
+ }
+ case DATATYPE:{
jj_consume_token(DATATYPE);
dt = IRIref();
break;
+ }
default:
jj_la1[18] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
+ }
default:
jj_la1[19] = jj_gen;
-
+ ;
}
- {if (true) return createLiteral(lex, lang, dt) ;}
+{if ("" != null) return createLiteral(lex, lang, dt) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public String Langtag() throws ParseException {
- Token t ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LANGTAG:
+ final public String Langtag() throws ParseException {Token t ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LANGTAG:{
t = jj_consume_token(LANGTAG);
break;
+ }
case PREFIX:
- case BASE:
+ case BASE:{
t = AnyDirective();
break;
+ }
default:
jj_la1[20] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- String lang = stripChars(t.image, 1) ; {if (true) return lang ;}
+String lang = stripChars(t.image, 1) ; {if ("" != null) return lang ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Token AnyDirective() throws ParseException {
- Token t ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PREFIX:
+ final public Token AnyDirective() throws ParseException {Token t ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case PREFIX:{
t = jj_consume_token(PREFIX);
break;
- case BASE:
+ }
+ case BASE:{
t = jj_consume_token(BASE);
break;
+ }
default:
jj_la1[21] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return t ;}
+{if ("" != null) return t ;}
throw new Error("Missing return statement in function");
- }
+}
final public Node BooleanLiteral() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case TRUE:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case TRUE:{
jj_consume_token(TRUE);
- {if (true) return XSD_TRUE ;}
+{if ("" != null) return XSD_TRUE ;}
break;
- case FALSE:
+ }
+ case FALSE:{
jj_consume_token(FALSE);
- {if (true) return XSD_FALSE ;}
+{if ("" != null) return XSD_FALSE ;}
break;
+ }
default:
jj_la1[22] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public String String() throws ParseException {
- Token t ; String lex ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STRING_LITERAL1:
+ final public String String() throws ParseException {Token t ; String lex ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case STRING_LITERAL1:{
t = jj_consume_token(STRING_LITERAL1);
- lex = stripQuotes(t.image) ;
+lex = stripQuotes(t.image) ;
break;
- case STRING_LITERAL2:
+ }
+ case STRING_LITERAL2:{
t = jj_consume_token(STRING_LITERAL2);
- lex = stripQuotes(t.image) ;
+lex = stripQuotes(t.image) ;
break;
- case STRING_LITERAL_LONG1:
+ }
+ case STRING_LITERAL_LONG1:{
t = jj_consume_token(STRING_LITERAL_LONG1);
- lex = stripQuotes3(t.image) ;
+lex = stripQuotes3(t.image) ;
break;
- case STRING_LITERAL_LONG2:
+ }
+ case STRING_LITERAL_LONG2:{
t = jj_consume_token(STRING_LITERAL_LONG2);
- lex = stripQuotes3(t.image) ;
+lex = stripQuotes3(t.image) ;
break;
+ }
default:
jj_la1[23] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- lex = unescapeStr(lex, t.beginLine, t.beginColumn) ;
- {if (true) return lex ;}
+lex = unescapeStr(lex, t.beginLine, t.beginColumn) ;
+ {if ("" != null) return lex ;}
throw new Error("Missing return statement in function");
- }
+}
- final public String IRIref() throws ParseException {
- String iri ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IRIref:
+ final public String IRIref() throws ParseException {String iri ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case IRIref:{
iri = IRI_REF();
- {if (true) return iri ;}
+{if ("" != null) return iri ;}
break;
+ }
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
iri = PrefixedName();
- {if (true) return iri ;}
+{if ("" != null) return iri ;}
break;
+ }
default:
jj_la1[24] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public String PrefixedName() throws ParseException {
- Token t ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PNAME_LN:
+ final public String PrefixedName() throws ParseException {Token t ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case PNAME_LN:{
t = jj_consume_token(PNAME_LN);
- {if (true) return resolvePName(t.image, t.beginLine, t.beginColumn) ;}
+{if ("" != null) return resolvePName(t.image, t.beginLine, t.beginColumn) ;}
break;
- case PNAME_NS:
+ }
+ case PNAME_NS:{
t = jj_consume_token(PNAME_NS);
- {if (true) return resolvePName(t.image, t.beginLine, t.beginColumn) ;}
+{if ("" != null) return resolvePName(t.image, t.beginLine, t.beginColumn) ;}
break;
+ }
default:
jj_la1[25] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Node BlankNode() throws ParseException {
- Token t = null ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BLANK_NODE_LABEL:
+ final public Node BlankNode() throws ParseException {Token t = null ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case BLANK_NODE_LABEL:{
t = jj_consume_token(BLANK_NODE_LABEL);
- {if (true) return createBNode(t.image, t.beginLine, t.beginColumn) ;}
+{if ("" != null) return createBNode(t.image, t.beginLine, t.beginColumn) ;}
break;
- case ANON:
+ }
+ case ANON:{
jj_consume_token(ANON);
- {if (true) return createBNode() ;}
+{if ("" != null) return createBNode() ;}
break;
+ }
default:
jj_la1[26] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public String IRI_REF() throws ParseException {
- Token t ;
+ final public String IRI_REF() throws ParseException {Token t ;
t = jj_consume_token(IRIref);
- {if (true) return resolveQuotedIRI(t.image, t.beginLine, t.beginColumn) ;}
+{if ("" != null) return resolveQuotedIRI(t.image, t.beginLine, t.beginColumn) ;}
throw new Error("Missing return statement in function");
- }
+}
/** Generated Token Manager. */
public TurtleParserTokenManager token_source;
@@ -753,166 +790,181 @@ public class TurtleParser extends TurtleParserBase implements TurtleParserConsta
static private int[] jj_la1_1;
static private int[] jj_la1_2;
static {
- jj_la1_init_0();
- jj_la1_init_1();
- jj_la1_init_2();
- }
- private static void jj_la1_init_0() {
- jj_la1_0 = new int[] {0x0,0xde1fc000,0xde1fc000,0xc000,0xde1f0000,0xc0002000,0x0,0xc0002000,0x0,0xc0002000,0x0,0xde1f0000,0xde1f0000,0xde1f0000,0x0,0xde1f0000,0xde1f0000,0x1c0000,0xc000,0xc000,0xc000,0xc000,0x30000,0x1e000000,0xc0000000,0x80000000,0x0,};
- }
- private static void jj_la1_init_1() {
- jj_la1_1 = new int[] {0x4000000,0x2b47,0x2b47,0x0,0x2b47,0x60001,0x4000,0x60001,0x8000,0x60001,0x840,0x2b47,0x2b47,0x2307,0x10000,0x2b47,0x2103,0x0,0x8000008,0x8000008,0x8,0x0,0x0,0x0,0x1,0x1,0x2002,};
- }
- private static void jj_la1_init_2() {
- jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
- }
+ jj_la1_init_0();
+ jj_la1_init_1();
+ jj_la1_init_2();
+ }
+ private static void jj_la1_init_0() {
+ jj_la1_0 = new int[] {0x0,0xde1fc000,0xde1fc000,0xc000,0xde1f0000,0xc0002000,0x0,0xc0002000,0x0,0xc0002000,0x0,0xde1f0000,0xde1f0000,0xde1f0000,0x0,0xde1f0000,0xde1f0000,0x1c0000,0xc000,0xc000,0xc000,0xc000,0x30000,0x1e000000,0xc0000000,0x80000000,0x0,};
+ }
+ private static void jj_la1_init_1() {
+ jj_la1_1 = new int[] {0x4000000,0x2b47,0x2b47,0x0,0x2b47,0x60001,0x4000,0x60001,0x8000,0x60001,0x840,0x2b47,0x2b47,0x2307,0x10000,0x2b47,0x2103,0x0,0x8000008,0x8000008,0x8,0x0,0x0,0x0,0x1,0x1,0x2002,};
+ }
+ private static void jj_la1_init_2() {
+ jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
+ }
/** Constructor with InputStream. */
public TurtleParser(java.io.InputStream stream) {
- this(stream, null);
+ this(stream, null);
}
/** Constructor with InputStream and supplied encoding */
public TurtleParser(java.io.InputStream stream, String encoding) {
- try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
- token_source = new TurtleParserTokenManager(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 27; i++) jj_la1[i] = -1;
+ try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source = new TurtleParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 27; i++) jj_la1[i] = -1;
}
/** Reinitialise. */
public void ReInit(java.io.InputStream stream) {
- ReInit(stream, null);
+ ReInit(stream, null);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream stream, String encoding) {
- try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
- token_source.ReInit(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 27; i++) jj_la1[i] = -1;
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 27; i++) jj_la1[i] = -1;
}
/** Constructor. */
public TurtleParser(java.io.Reader stream) {
- jj_input_stream = new JavaCharStream(stream, 1, 1);
- token_source = new TurtleParserTokenManager(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 27; i++) jj_la1[i] = -1;
+ jj_input_stream = new JavaCharStream(stream, 1, 1);
+ token_source = new TurtleParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 27; i++) jj_la1[i] = -1;
}
/** Reinitialise. */
public void ReInit(java.io.Reader stream) {
- jj_input_stream.ReInit(stream, 1, 1);
- token_source.ReInit(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 27; i++) jj_la1[i] = -1;
+ if (jj_input_stream == null) {
+ jj_input_stream = new JavaCharStream(stream, 1, 1);
+ } else {
+ jj_input_stream.ReInit(stream, 1, 1);
+ }
+ if (token_source == null) {
+ token_source = new TurtleParserTokenManager(jj_input_stream);
+ }
+
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 27; i++) jj_la1[i] = -1;
}
/** Constructor with generated Token Manager. */
public TurtleParser(TurtleParserTokenManager tm) {
- token_source = tm;
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 27; i++) jj_la1[i] = -1;
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 27; i++) jj_la1[i] = -1;
}
/** Reinitialise. */
public void ReInit(TurtleParserTokenManager tm) {
- token_source = tm;
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 27; i++) jj_la1[i] = -1;
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 27; i++) jj_la1[i] = -1;
}
private Token jj_consume_token(int kind) throws ParseException {
- Token oldToken;
- if ((oldToken = token).next != null) token = token.next;
- else token = token.next = token_source.getNextToken();
- jj_ntk = -1;
- if (token.kind == kind) {
- jj_gen++;
- return token;
- }
- token = oldToken;
- jj_kind = kind;
- throw generateParseException();
+ Token oldToken;
+ if ((oldToken = token).next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ if (token.kind == kind) {
+ jj_gen++;
+ return token;
+ }
+ token = oldToken;
+ jj_kind = kind;
+ throw generateParseException();
}
/** Get the next Token. */
final public Token getNextToken() {
- if (token.next != null) token = token.next;
- else token = token.next = token_source.getNextToken();
- jj_ntk = -1;
- jj_gen++;
- return token;
+ if (token.next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ jj_gen++;
+ return token;
}
/** Get the specific Token. */
final public Token getToken(int index) {
- Token t = token;
- for (int i = 0; i < index; i++) {
- if (t.next != null) t = t.next;
- else t = t.next = token_source.getNextToken();
- }
- return t;
+ Token t = token;
+ for (int i = 0; i < index; i++) {
+ if (t.next != null) t = t.next;
+ else t = t.next = token_source.getNextToken();
+ }
+ return t;
}
- private int jj_ntk() {
- if ((jj_nt=token.next) == null)
- return (jj_ntk = (token.next=token_source.getNextToken()).kind);
- else
- return (jj_ntk = jj_nt.kind);
+ private int jj_ntk_f() {
+ if ((jj_nt=token.next) == null)
+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);
+ else
+ return (jj_ntk = jj_nt.kind);
}
- private java.util.List<int[]> jj_expentries = new java.util.ArrayList<>();
+ private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
private int[] jj_expentry;
private int jj_kind = -1;
/** Generate ParseException. */
public ParseException generateParseException() {
- jj_expentries.clear();
- boolean[] la1tokens = new boolean[68];
- if (jj_kind >= 0) {
- la1tokens[jj_kind] = true;
- jj_kind = -1;
- }
- for (int i = 0; i < 27; i++) {
- if (jj_la1[i] == jj_gen) {
- for (int j = 0; j < 32; j++) {
- if ((jj_la1_0[i] & (1<<j)) != 0) {
- la1tokens[j] = true;
- }
- if ((jj_la1_1[i] & (1<<j)) != 0) {
- la1tokens[32+j] = true;
- }
- if ((jj_la1_2[i] & (1<<j)) != 0) {
- la1tokens[64+j] = true;
- }
- }
- }
- }
- for (int i = 0; i < 68; i++) {
- if (la1tokens[i]) {
- jj_expentry = new int[1];
- jj_expentry[0] = i;
- jj_expentries.add(jj_expentry);
- }
- }
- int[][] exptokseq = new int[jj_expentries.size()][];
- for (int i = 0; i < jj_expentries.size(); i++) {
- exptokseq[i] = jj_expentries.get(i);
- }
- return new ParseException(token, exptokseq, tokenImage);
+ jj_expentries.clear();
+ boolean[] la1tokens = new boolean[68];
+ if (jj_kind >= 0) {
+ la1tokens[jj_kind] = true;
+ jj_kind = -1;
+ }
+ for (int i = 0; i < 27; i++) {
+ if (jj_la1[i] == jj_gen) {
+ for (int j = 0; j < 32; j++) {
+ if ((jj_la1_0[i] & (1<<j)) != 0) {
+ la1tokens[j] = true;
+ }
+ if ((jj_la1_1[i] & (1<<j)) != 0) {
+ la1tokens[32+j] = true;
+ }
+ if ((jj_la1_2[i] & (1<<j)) != 0) {
+ la1tokens[64+j] = true;
+ }
+ }
+ }
+ }
+ for (int i = 0; i < 68; i++) {
+ if (la1tokens[i]) {
+ jj_expentry = new int[1];
+ jj_expentry[0] = i;
+ jj_expentries.add(jj_expentry);
+ }
+ }
+ int[][] exptokseq = new int[jj_expentries.size()][];
+ for (int i = 0; i < jj_expentries.size(); i++) {
+ exptokseq[i] = jj_expentries.get(i);
+ }
+ return new ParseException(token, exptokseq, tokenImage);
+ }
+
+ private boolean trace_enabled;
+
+/** Trace enabled. */
+ final public boolean trace_enabled() {
+ return trace_enabled;
}
/** Enable tracing. */
diff --git a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TurtleParserConstants.java b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TurtleParserConstants.java
index 826cce128f..618c3a56bd 100644
--- a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TurtleParserConstants.java
+++ b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TurtleParserConstants.java
@@ -17,7 +17,7 @@
* limitations under the License.
*/
-package org.apache.jena.ttl.turtle.parser ;
+package org.apache.jena.ttl.turtle.parser;
/**
diff --git a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TurtleParserTokenManager.java b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TurtleParserTokenManager.java
index e14c0a9df0..7df2cab704 100644
--- a/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TurtleParserTokenManager.java
+++ b/jena-core/src/main/java/org/apache/jena/ttl/turtle/parser/TurtleParserTokenManager.java
@@ -1,3 +1,4 @@
+/* TurtleParserTokenManager.java */
/* Generated By:JavaCC: Do not edit this line. TurtleParserTokenManager.java */
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -17,13 +18,13 @@
* limitations under the License.
*/
-package org.apache.jena.ttl.turtle.parser ;
-
-
+package org.apache.jena.ttl.turtle.parser;
+import org.apache.jena.ttl.turtle.*;
+import org.apache.jena.graph.* ;
/** Token Manager. */
-public class TurtleParserTokenManager implements TurtleParserConstants
-{
+@SuppressWarnings ("unused")
+public class TurtleParserTokenManager implements TurtleParserConstants {
/** Debug output. */
public java.io.PrintStream debugStream = System.out;
@@ -35,8 +36,7 @@ private int jjStopAtPos(int pos, int kind)
jjmatchedPos = pos;
return pos + 1;
}
-private int jjMoveStringLiteralDfa0_0()
-{
+private int jjMoveStringLiteralDfa0_0(){
switch(curChar)
{
case 9:
@@ -139,8 +139,7 @@ private int jjMoveStringLiteralDfa0_0()
return jjMoveNfa_0(0, 0);
}
}
-private int jjMoveStringLiteralDfa1_0(long active0)
-{
+private int jjMoveStringLiteralDfa1_0(long active0){
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
return jjMoveNfa_0(0, 0);
@@ -190,8 +189,7 @@ private int jjMoveStringLiteralDfa1_0(long active0)
}
return jjMoveNfa_0(0, 1);
}
-private int jjMoveStringLiteralDfa2_0(long old0, long active0)
-{
+private int jjMoveStringLiteralDfa2_0(long old0, long active0){
if (((active0 &= old0)) == 0L)
return jjMoveNfa_0(0, 1);
try { curChar = input_stream.readChar(); }
@@ -217,8 +215,7 @@ private int jjMoveStringLiteralDfa2_0(long old0, long active0)
}
return jjMoveNfa_0(0, 2);
}
-private int jjMoveStringLiteralDfa3_0(long old0, long active0)
-{
+private int jjMoveStringLiteralDfa3_0(long old0, long active0){
if (((active0 &= old0)) == 0L)
return jjMoveNfa_0(0, 2);
try { curChar = input_stream.readChar(); }
@@ -250,8 +247,7 @@ private int jjMoveStringLiteralDfa3_0(long old0, long active0)
}
return jjMoveNfa_0(0, 3);
}
-private int jjMoveStringLiteralDfa4_0(long old0, long active0)
-{
+private int jjMoveStringLiteralDfa4_0(long old0, long active0){
if (((active0 &= old0)) == 0L)
return jjMoveNfa_0(0, 3);
try { curChar = input_stream.readChar(); }
@@ -286,8 +282,7 @@ private int jjMoveStringLiteralDfa4_0(long old0, long active0)
}
return jjMoveNfa_0(0, 4);
}
-private int jjMoveStringLiteralDfa5_0(long old0, long active0)
-{
+private int jjMoveStringLiteralDfa5_0(long old0, long active0){
if (((active0 &= old0)) == 0L)
return jjMoveNfa_0(0, 4);
try { curChar = input_stream.readChar(); }
@@ -303,8 +298,7 @@ private int jjMoveStringLiteralDfa5_0(long old0, long active0)
}
return jjMoveNfa_0(0, 5);
}
-private int jjMoveStringLiteralDfa6_0(long old0, long active0)
-{
+private int jjMoveStringLiteralDfa6_0(long old0, long active0){
if (((active0 &= old0)) == 0L)
return jjMoveNfa_0(0, 5);
try { curChar = input_stream.readChar(); }
@@ -391,22 +385,22 @@ private int jjMoveNfa_0(int startState, int curPos)
{
if (kind > 18)
kind = 18;
- jjCheckNAddStates(0, 7);
+ { jjCheckNAddStates(0, 7); }
}
else if ((0x280000000000L & l) != 0L)
- jjCheckNAddStates(8, 12);
+ { jjCheckNAddStates(8, 12); }
else if (curChar == 58)
{
if (kind > 31)
kind = 31;
- jjCheckNAdd(105);
+ { jjCheckNAdd(105); }
}
else if (curChar == 46)
- jjCheckNAddTwoStates(78, 80);
+ { jjCheckNAddTwoStates(78, 80); }
else if (curChar == 40)
- jjCheckNAddStates(13, 15);
+ { jjCheckNAddStates(13, 15); }
else if (curChar == 60)
- jjCheckNAddTwoStates(42, 43);
+ { jjCheckNAddTwoStates(42, 43); }
else if (curChar == 34)
jjstateSet[jjnewStateCnt++] = 39;
else if (curChar == 39)
@@ -415,21 +409,21 @@ private int jjMoveNfa_0(int startState, int curPos)
{
if (kind > 12)
kind = 12;
- jjCheckNAddStates(16, 18);
+ { jjCheckNAddStates(16, 18); }
}
else if (curChar == 63)
jjstateSet[jjnewStateCnt++] = 50;
if (curChar == 34)
- jjCheckNAddStates(19, 21);
+ { jjCheckNAddStates(19, 21); }
else if (curChar == 39)
- jjCheckNAddStates(22, 24);
+ { jjCheckNAddStates(22, 24); }
break;
case 1:
if ((0xffffffffffffdbffL & l) == 0L)
break;
if (kind > 12)
kind = 12;
- jjCheckNAddStates(16, 18);
+ { jjCheckNAddStates(16, 18); }
break;
case 2:
if ((0x2400L & l) != 0L && kind > 12)
@@ -449,15 +443,15 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 7:
if (curChar == 39)
- jjCheckNAddStates(22, 24);
+ { jjCheckNAddStates(22, 24); }
break;
case 8:
if ((0xffffff7fffffdbffL & l) != 0L)
- jjCheckNAddStates(22, 24);
+ { jjCheckNAddStates(22, 24); }
break;
case 10:
if ((0x8400000000L & l) != 0L)
- jjCheckNAddStates(22, 24);
+ { jjCheckNAddStates(22, 24); }
break;
case 11:
if (curChar == 39 && kind > 25)
@@ -465,15 +459,15 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 12:
if (curChar == 34)
- jjCheckNAddStates(19, 21);
+ { jjCheckNAddStates(19, 21); }
break;
case 13:
if ((0xfffffffbffffdbffL & l) != 0L)
- jjCheckNAddStates(19, 21);
+ { jjCheckNAddStates(19, 21); }
break;
case 15:
if ((0x8400000000L & l) != 0L)
- jjCheckNAddStates(19, 21);
+ { jjCheckNAddStates(19, 21); }
break;
case 16:
if (curChar == 34 && kind > 26)
@@ -481,25 +475,25 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 17:
if (curChar == 39)
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 18:
case 22:
if ((0xffffff7fffffffffL & l) != 0L)
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 20:
if ((0x8400000000L & l) != 0L)
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 21:
case 24:
if (curChar == 39)
- jjCheckNAdd(22);
+ { jjCheckNAdd(22); }
break;
case 23:
if (curChar == 39)
- jjAddStates(29, 30);
+ { jjAddStates(29, 30); }
break;
case 25:
if (curChar == 39 && kind > 27)
@@ -519,25 +513,25 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 29:
if (curChar == 34)
- jjCheckNAddStates(31, 34);
+ { jjCheckNAddStates(31, 34); }
break;
case 30:
case 34:
if ((0xfffffffbffffffffL & l) != 0L)
- jjCheckNAddStates(31, 34);
+ { jjCheckNAddStates(31, 34); }
break;
case 32:
if ((0x8400000000L & l) != 0L)
- jjCheckNAddStates(31, 34);
+ { jjCheckNAddStates(31, 34); }
break;
case 33:
case 36:
if (curChar == 34)
- jjCheckNAdd(34);
+ { jjCheckNAdd(34); }
break;
case 35:
if (curChar == 34)
- jjAddStates(35, 36);
+ { jjAddStates(35, 36); }
break;
case 37:
if (curChar == 34 && kind > 28)
@@ -557,11 +551,11 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 41:
if (curChar == 60)
- jjCheckNAddTwoStates(42, 43);
+ { jjCheckNAddTwoStates(42, 43); }
break;
case 42:
if ((0xaffffffa00000000L & l) != 0L)
- jjCheckNAddTwoStates(42, 43);
+ { jjCheckNAddTwoStates(42, 43); }
break;
case 43:
if (curChar == 62 && kind > 30)
@@ -576,11 +570,11 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
if (kind > 33)
kind = 33;
- jjCheckNAddTwoStates(46, 47);
+ { jjCheckNAddTwoStates(46, 47); }
break;
case 46:
if ((0x3ff600000000000L & l) != 0L)
- jjCheckNAddTwoStates(46, 47);
+ { jjCheckNAddTwoStates(46, 47); }
break;
case 47:
if ((0x3ff200000000000L & l) != 0L && kind > 33)
@@ -596,38 +590,38 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
if (kind > 34)
kind = 34;
- jjCheckNAdd(51);
+ { jjCheckNAdd(51); }
break;
case 54:
if (curChar == 45)
- jjCheckNAdd(55);
+ { jjCheckNAdd(55); }
break;
case 55:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 35)
kind = 35;
- jjCheckNAddTwoStates(54, 55);
+ { jjCheckNAddTwoStates(54, 55); }
break;
case 56:
if (curChar == 40)
- jjCheckNAddStates(13, 15);
+ { jjCheckNAddStates(13, 15); }
break;
case 57:
if (curChar == 35)
- jjCheckNAddStates(37, 42);
+ { jjCheckNAddStates(37, 42); }
break;
case 58:
if ((0xffffffffffffdbffL & l) != 0L)
- jjCheckNAddStates(37, 42);
+ { jjCheckNAddStates(37, 42); }
break;
case 59:
if ((0x2400L & l) != 0L)
- jjCheckNAddStates(13, 15);
+ { jjCheckNAddStates(13, 15); }
break;
case 60:
if ((0x100003600L & l) != 0L)
- jjCheckNAddStates(13, 15);
+ { jjCheckNAddStates(13, 15); }
break;
case 61:
if (curChar == 41 && kind > 40)
@@ -635,7 +629,7 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 62:
if (curChar == 10)
- jjCheckNAddStates(13, 15);
+ { jjCheckNAddStates(13, 15); }
break;
case 63:
if (curChar == 13)
@@ -643,23 +637,23 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 65:
if (curChar == 35)
- jjCheckNAddStates(43, 48);
+ { jjCheckNAddStates(43, 48); }
break;
case 66:
if ((0xffffffffffffdbffL & l) != 0L)
- jjCheckNAddStates(43, 48);
+ { jjCheckNAddStates(43, 48); }
break;
case 67:
if ((0x2400L & l) != 0L)
- jjCheckNAddStates(49, 51);
+ { jjCheckNAddStates(49, 51); }
break;
case 68:
if ((0x100003600L & l) != 0L)
- jjCheckNAddStates(49, 51);
+ { jjCheckNAddStates(49, 51); }
break;
case 70:
if (curChar == 10)
- jjCheckNAddStates(49, 51);
+ { jjCheckNAddStates(49, 51); }
break;
case 71:
if (curChar == 13)
@@ -667,126 +661,126 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 72:
if ((0x280000000000L & l) != 0L)
- jjCheckNAddStates(8, 12);
+ { jjCheckNAddStates(8, 12); }
break;
case 73:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 18)
kind = 18;
- jjCheckNAdd(73);
+ { jjCheckNAdd(73); }
break;
case 74:
if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(74, 75);
+ { jjCheckNAddTwoStates(74, 75); }
break;
case 75:
if (curChar != 46)
break;
if (kind > 19)
kind = 19;
- jjCheckNAdd(76);
+ { jjCheckNAdd(76); }
break;
case 76:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 19)
kind = 19;
- jjCheckNAdd(76);
+ { jjCheckNAdd(76); }
break;
case 77:
if (curChar == 46)
- jjCheckNAdd(78);
+ { jjCheckNAdd(78); }
break;
case 78:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 19)
kind = 19;
- jjCheckNAdd(78);
+ { jjCheckNAdd(78); }
break;
case 79:
if (curChar == 46)
- jjCheckNAdd(80);
+ { jjCheckNAdd(80); }
break;
case 80:
if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(80, 81);
+ { jjCheckNAddTwoStates(80, 81); }
break;
case 82:
if ((0x280000000000L & l) != 0L)
- jjCheckNAdd(83);
+ { jjCheckNAdd(83); }
break;
case 83:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 20)
kind = 20;
- jjCheckNAdd(83);
+ { jjCheckNAdd(83); }
break;
case 84:
if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddStates(52, 55);
+ { jjCheckNAddStates(52, 55); }
break;
case 85:
if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(85, 86);
+ { jjCheckNAddTwoStates(85, 86); }
break;
case 86:
if (curChar == 46)
- jjCheckNAddTwoStates(87, 88);
+ { jjCheckNAddTwoStates(87, 88); }
break;
case 87:
if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(87, 88);
+ { jjCheckNAddTwoStates(87, 88); }
break;
case 89:
if ((0x280000000000L & l) != 0L)
- jjCheckNAdd(90);
+ { jjCheckNAdd(90); }
break;
case 90:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 20)
kind = 20;
- jjCheckNAdd(90);
+ { jjCheckNAdd(90); }
break;
case 91:
if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(91, 92);
+ { jjCheckNAddTwoStates(91, 92); }
break;
case 93:
if ((0x280000000000L & l) != 0L)
- jjCheckNAdd(94);
+ { jjCheckNAdd(94); }
break;
case 94:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 20)
kind = 20;
- jjCheckNAdd(94);
+ { jjCheckNAdd(94); }
break;
case 95:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 18)
kind = 18;
- jjCheckNAddStates(0, 7);
+ { jjCheckNAddStates(0, 7); }
break;
case 96:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 29)
kind = 29;
- jjCheckNAdd(96);
+ { jjCheckNAdd(96); }
break;
case 97:
if (curChar == 46)
- jjCheckNAddTwoStates(78, 80);
+ { jjCheckNAddTwoStates(78, 80); }
break;
case 99:
if ((0x3ff600000000000L & l) != 0L)
- jjAddStates(56, 57);
+ { jjAddStates(56, 57); }
break;
case 100:
if ((0x3ff200000000000L & l) != 0L)
@@ -798,7 +792,7 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 102:
if ((0x3ff600000000000L & l) != 0L)
- jjAddStates(58, 59);
+ { jjAddStates(58, 59); }
break;
case 103:
if ((0x3ff200000000000L & l) != 0L)
@@ -806,18 +800,18 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 104:
if (curChar == 58)
- jjCheckNAdd(105);
+ { jjCheckNAdd(105); }
break;
case 105:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 32)
kind = 32;
- jjCheckNAddTwoStates(106, 107);
+ { jjCheckNAddTwoStates(106, 107); }
break;
case 106:
if ((0x3ff600000000000L & l) != 0L)
- jjCheckNAddTwoStates(106, 107);
+ { jjCheckNAddTwoStates(106, 107); }
break;
case 107:
if ((0x3ff200000000000L & l) != 0L && kind > 32)
@@ -828,7 +822,7 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
if (kind > 31)
kind = 31;
- jjCheckNAdd(105);
+ { jjCheckNAdd(105); }
break;
default : break;
}
@@ -843,11 +837,11 @@ private int jjMoveNfa_0(int startState, int curPos)
{
case 0:
if ((0x7fffffe07fffffeL & l) != 0L)
- jjCheckNAddStates(60, 65);
+ { jjCheckNAddStates(60, 65); }
else if (curChar == 91)
- jjCheckNAddStates(49, 51);
+ { jjCheckNAddStates(49, 51); }
else if (curChar == 64)
- jjCheckNAdd(53);
+ { jjCheckNAdd(53); }
else if (curChar == 95)
jjstateSet[jjnewStateCnt++] = 44;
else if (curChar == 92)
@@ -856,7 +850,7 @@ private int jjMoveNfa_0(int startState, int curPos)
case 1:
if (kind > 12)
kind = 12;
- jjAddStates(16, 18);
+ { jjAddStates(16, 18); }
break;
case 5:
if (curChar == 92)
@@ -868,7 +862,7 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 8:
if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(22, 24);
+ { jjCheckNAddStates(22, 24); }
break;
case 9:
if (curChar == 92)
@@ -876,11 +870,11 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 10:
if ((0x14404410144044L & l) != 0L)
- jjCheckNAddStates(22, 24);
+ { jjCheckNAddStates(22, 24); }
break;
case 13:
if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(19, 21);
+ { jjCheckNAddStates(19, 21); }
break;
case 14:
if (curChar == 92)
@@ -888,11 +882,11 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 15:
if ((0x14404410144044L & l) != 0L)
- jjCheckNAddStates(19, 21);
+ { jjCheckNAddStates(19, 21); }
break;
case 18:
if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 19:
if (curChar == 92)
@@ -900,14 +894,14 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 20:
if ((0x14404410144044L & l) != 0L)
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 22:
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 30:
if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(31, 34);
+ { jjCheckNAddStates(31, 34); }
break;
case 31:
if (curChar == 92)
@@ -915,25 +909,25 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 32:
if ((0x14404410144044L & l) != 0L)
- jjCheckNAddStates(31, 34);
+ { jjCheckNAddStates(31, 34); }
break;
case 34:
- jjCheckNAddStates(31, 34);
+ { jjCheckNAddStates(31, 34); }
break;
case 42:
if ((0xc7fffffeafffffffL & l) != 0L)
- jjAddStates(66, 67);
+ { jjAddStates(66, 67); }
break;
case 45:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
if (kind > 33)
kind = 33;
- jjCheckNAddTwoStates(46, 47);
+ { jjCheckNAddTwoStates(46, 47); }
break;
case 46:
if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAddTwoStates(46, 47);
+ { jjCheckNAddTwoStates(46, 47); }
break;
case 47:
if ((0x7fffffe87fffffeL & l) != 0L && kind > 33)
@@ -949,35 +943,35 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
if (kind > 34)
kind = 34;
- jjCheckNAdd(51);
+ { jjCheckNAdd(51); }
break;
case 52:
if (curChar == 64)
- jjCheckNAdd(53);
+ { jjCheckNAdd(53); }
break;
case 53:
if ((0x7fffffe07fffffeL & l) == 0L)
break;
if (kind > 35)
kind = 35;
- jjCheckNAddTwoStates(53, 54);
+ { jjCheckNAddTwoStates(53, 54); }
break;
case 55:
if ((0x7fffffe07fffffeL & l) == 0L)
break;
if (kind > 35)
kind = 35;
- jjCheckNAddTwoStates(54, 55);
+ { jjCheckNAddTwoStates(54, 55); }
break;
case 58:
- jjAddStates(37, 42);
+ { jjAddStates(37, 42); }
break;
case 64:
if (curChar == 91)
- jjCheckNAddStates(49, 51);
+ { jjCheckNAddStates(49, 51); }
break;
case 66:
- jjCheckNAddStates(43, 48);
+ { jjCheckNAddStates(43, 48); }
break;
case 69:
if (curChar == 93 && kind > 45)
@@ -985,46 +979,46 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 81:
if ((0x2000000020L & l) != 0L)
- jjAddStates(68, 69);
+ { jjAddStates(68, 69); }
break;
case 88:
if ((0x2000000020L & l) != 0L)
- jjAddStates(70, 71);
+ { jjAddStates(70, 71); }
break;
case 92:
if ((0x2000000020L & l) != 0L)
- jjAddStates(72, 73);
+ { jjAddStates(72, 73); }
break;
case 98:
if ((0x7fffffe07fffffeL & l) != 0L)
- jjCheckNAddStates(60, 65);
+ { jjCheckNAddStates(60, 65); }
break;
case 99:
if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAddTwoStates(99, 100);
+ { jjCheckNAddTwoStates(99, 100); }
break;
case 100:
if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAdd(101);
+ { jjCheckNAdd(101); }
break;
case 102:
if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAddTwoStates(102, 103);
+ { jjCheckNAddTwoStates(102, 103); }
break;
case 103:
if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAdd(104);
+ { jjCheckNAdd(104); }
break;
case 105:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
if (kind > 32)
kind = 32;
- jjCheckNAddTwoStates(106, 107);
+ { jjCheckNAddTwoStates(106, 107); }
break;
case 106:
if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAddTwoStates(106, 107);
+ { jjCheckNAddTwoStates(106, 107); }
break;
case 107:
if ((0x7fffffe87fffffeL & l) != 0L && kind > 32)
@@ -1047,47 +1041,47 @@ private int jjMoveNfa_0(int startState, int curPos)
{
case 0:
if (jjCanMove_1(hiByte, i1, i2, l1, l2))
- jjCheckNAddStates(60, 65);
+ { jjCheckNAddStates(60, 65); }
break;
case 1:
if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
break;
if (kind > 12)
kind = 12;
- jjAddStates(16, 18);
+ { jjAddStates(16, 18); }
break;
case 8:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(22, 24);
+ { jjAddStates(22, 24); }
break;
case 13:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(19, 21);
+ { jjAddStates(19, 21); }
break;
case 18:
case 22:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 30:
case 34:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjCheckNAddStates(31, 34);
+ { jjCheckNAddStates(31, 34); }
break;
case 42:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(66, 67);
+ { jjAddStates(66, 67); }
break;
case 45:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
if (kind > 33)
kind = 33;
- jjCheckNAddTwoStates(46, 47);
+ { jjCheckNAddTwoStates(46, 47); }
break;
case 46:
if (jjCanMove_2(hiByte, i1, i2, l1, l2))
- jjCheckNAddTwoStates(46, 47);
+ { jjCheckNAddTwoStates(46, 47); }
break;
case 47:
if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 33)
@@ -1098,55 +1092,55 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
if (kind > 34)
kind = 34;
- jjCheckNAdd(51);
+ { jjCheckNAdd(51); }
break;
case 51:
if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
break;
if (kind > 34)
kind = 34;
- jjCheckNAdd(51);
+ { jjCheckNAdd(51); }
break;
case 58:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(37, 42);
+ { jjAddStates(37, 42); }
break;
case 66:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(43, 48);
+ { jjAddStates(43, 48); }
break;
case 99:
if (jjCanMove_2(hiByte, i1, i2, l1, l2))
- jjCheckNAddTwoStates(99, 100);
+ { jjCheckNAddTwoStates(99, 100); }
break;
case 100:
if (jjCanMove_2(hiByte, i1, i2, l1, l2))
- jjCheckNAdd(101);
+ { jjCheckNAdd(101); }
break;
case 102:
if (jjCanMove_2(hiByte, i1, i2, l1, l2))
- jjCheckNAddTwoStates(102, 103);
+ { jjCheckNAddTwoStates(102, 103); }
break;
case 103:
if (jjCanMove_2(hiByte, i1, i2, l1, l2))
- jjCheckNAdd(104);
+ { jjCheckNAdd(104); }
break;
case 105:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
if (kind > 32)
kind = 32;
- jjCheckNAddTwoStates(106, 107);
+ { jjCheckNAddTwoStates(106, 107); }
break;
case 106:
if (jjCanMove_2(hiByte, i1, i2, l1, l2))
- jjCheckNAddTwoStates(106, 107);
+ { jjCheckNAddTwoStates(106, 107); }
break;
case 107:
if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 32)
kind = 32;
break;
- default : break;
+ default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break;
}
} while(i != startsAt);
}
@@ -1182,6 +1176,39 @@ private int jjMoveNfa_0(int startState, int curPos)
return toRet;
}
+
+/** Token literal values. */
+public static final String[] jjstrLiteralImages = {
+"", "\41", "\174", "\136", "\55\76", "\74\55", null, null, null, null, null,
+null, null, "\141", "\100\160\162\145\146\151\170", "\100\142\141\163\145", null,
+null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+null, null, null, null, null, null, null, "\50", "\51", null, "\173", "\175",
+"\133", "\135", null, "\73", "\54", "\56", "\75", "\75\76", "\44", "\77", "\176",
+"\72", "\52", "\57", "\134", "\ufeff", "\136\136", "\100", null, null, null, null,
+null, null, null, };
+protected Token jjFillToken()
+{
+ final Token t;
+ final String curTokenImage;
+ final int beginLine;
+ final int endLine;
+ final int beginColumn;
+ final int endColumn;
+ String im = jjstrLiteralImages[jjmatchedKind];
+ curTokenImage = (im == null) ? input_stream.GetImage() : im;
+ beginLine = input_stream.getBeginLine();
+ beginColumn = input_stream.getBeginColumn();
+ endLine = input_stream.getEndLine();
+ endColumn = input_stream.getEndColumn();
+ t = Token.newToken(jjmatchedKind, curTokenImage);
+
+ t.beginLine = beginLine;
+ t.endLine = endLine;
+ t.beginColumn = beginColumn;
+ t.endColumn = endColumn;
+
+ return t;
+}
static final int[] jjnextStates = {
73, 74, 75, 85, 86, 91, 92, 96, 73, 74, 77, 79, 84, 57, 60, 61,
1, 2, 4, 13, 14, 16, 8, 9, 11, 18, 19, 21, 23, 24, 26, 30,
@@ -1250,102 +1277,6 @@ private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, lo
}
}
-/** Token literal values. */
-public static final String[] jjstrLiteralImages = {
-"", "\41", "\174", "\136", "\55\76", "\74\55", null, null, null, null, null,
-null, null, "\141", "\100\160\162\145\146\151\170", "\100\142\141\163\145", null,
-null, null, null, null, null, null, null, null, null, null, null, null, null, null,
-null, null, null, null, null, null, null, "\50", "\51", null, "\173", "\175",
-"\133", "\135", null, "\73", "\54", "\56", "\75", "\75\76", "\44", "\77", "\176",
-"\72", "\52", "\57", "\134", "\ufeff", "\136\136", "\100", null, null, null, null,
-null, null, null, };
-
-/** Lexer state names. */
-public static final String[] lexStateNames = {
- "DEFAULT",
-};
-static final long[] jjtoToken = {
- 0x1fffffcfff1fe03fL, 0x0L,
-};
-static final long[] jjtoSkip = {
- 0x17c0L, 0x0L,
-};
-static final long[] jjtoSpecial = {
- 0x1000L, 0x0L,
-};
-protected JavaCharStream input_stream;
-private final int[] jjrounds = new int[109];
-private final int[] jjstateSet = new int[218];
-protected char curChar;
-/** Constructor. */
-public TurtleParserTokenManager(JavaCharStream stream){
- if (JavaCharStream.staticFlag)
- throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
- input_stream = stream;
-}
-
-/** Constructor. */
-public TurtleParserTokenManager(JavaCharStream stream, int lexState){
- this(stream);
- SwitchTo(lexState);
-}
-
-/** Reinitialise parser. */
-public void ReInit(JavaCharStream stream)
-{
- jjmatchedPos = jjnewStateCnt = 0;
- curLexState = defaultLexState;
- input_stream = stream;
- ReInitRounds();
-}
-private void ReInitRounds()
-{
- int i;
- jjround = 0x80000001;
- for (i = 109; i-- > 0;)
- jjrounds[i] = 0x80000000;
-}
-
-/** Reinitialise parser. */
-public void ReInit(JavaCharStream stream, int lexState)
-{
- ReInit(stream);
- SwitchTo(lexState);
-}
-
-/** Switch to specified lex state. */
-public void SwitchTo(int lexState)
-{
- if (lexState >= 1 || lexState < 0)
- throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
- else
- curLexState = lexState;
-}
-
-protected Token jjFillToken()
-{
- final Token t;
- final String curTokenImage;
- final int beginLine;
- final int endLine;
- final int beginColumn;
- final int endColumn;
- String im = jjstrLiteralImages[jjmatchedKind];
- curTokenImage = (im == null) ? input_stream.GetImage() : im;
- beginLine = input_stream.getBeginLine();
- beginColumn = input_stream.getBeginColumn();
- endLine = input_stream.getEndLine();
- endColumn = input_stream.getEndColumn();
- t = Token.newToken(jjmatchedKind, curTokenImage);
-
- t.beginLine = beginLine;
- t.endLine = endLine;
- t.beginColumn = beginColumn;
- t.endColumn = endColumn;
-
- return t;
-}
-
int curLexState = 0;
int defaultLexState = 0;
int jjnewStateCnt;
@@ -1367,9 +1298,10 @@ public Token getNextToken()
{
curChar = input_stream.BeginToken();
}
- catch(java.io.IOException e)
+ catch(Exception e)
{
jjmatchedKind = 0;
+ jjmatchedPos = -1;
matchedToken = jjFillToken();
matchedToken.specialToken = specialToken;
return matchedToken;
@@ -1427,6 +1359,31 @@ public Token getNextToken()
}
}
+void SkipLexicalActions(Token matchedToken)
+{
+ switch(jjmatchedKind)
+ {
+ default :
+ break;
+ }
+}
+void MoreLexicalActions()
+{
+ jjimageLen += (lengthOfMatch = jjmatchedPos + 1);
+ switch(jjmatchedKind)
+ {
+ default :
+ break;
+ }
+}
+void TokenLexicalActions(Token matchedToken)
+{
+ switch(jjmatchedKind)
+ {
+ default :
+ break;
+ }
+}
private void jjCheckNAdd(int state)
{
if (jjrounds[state] != jjround)
@@ -1454,4 +1411,91 @@ private void jjCheckNAddStates(int start, int end)
} while (start++ != end);
}
+ /** Constructor. */
+ public TurtleParserTokenManager(JavaCharStream stream){
+
+ if (JavaCharStream.staticFlag)
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+
+ input_stream = stream;
+ }
+
+ /** Constructor. */
+ public TurtleParserTokenManager (JavaCharStream stream, int lexState){
+ ReInit(stream);
+ SwitchTo(lexState);
+ }
+
+ /** Reinitialise parser. */
+
+ public void ReInit(JavaCharStream stream)
+ {
+
+
+ jjmatchedPos =
+ jjnewStateCnt =
+ 0;
+ curLexState = defaultLexState;
+ input_stream = stream;
+ ReInitRounds();
+ }
+
+ private void ReInitRounds()
+ {
+ int i;
+ jjround = 0x80000001;
+ for (i = 109; i-- > 0;)
+ jjrounds[i] = 0x80000000;
+ }
+
+ /** Reinitialise parser. */
+ public void ReInit(JavaCharStream stream, int lexState)
+
+ {
+ ReInit(stream);
+ SwitchTo(lexState);
+ }
+
+ /** Switch to specified lex state. */
+ public void SwitchTo(int lexState)
+ {
+ if (lexState >= 1 || lexState < 0)
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+ else
+ curLexState = lexState;
+ }
+
+
+/** Lexer state names. */
+public static final String[] lexStateNames = {
+ "DEFAULT",
+};
+
+/** Lex State array. */
+public static final int[] jjnewLexState = {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+};
+static final long[] jjtoToken = {
+ 0x1fffffcfff1fe03fL, 0x0L,
+};
+static final long[] jjtoSkip = {
+ 0x17c0L, 0x0L,
+};
+static final long[] jjtoSpecial = {
+ 0x1000L, 0x0L,
+};
+static final long[] jjtoMore = {
+ 0x0L, 0x0L,
+};
+ protected JavaCharStream input_stream;
+
+ private final int[] jjrounds = new int[109];
+ private final int[] jjstateSet = new int[2 * 109];
+ private final StringBuilder jjimage = new StringBuilder();
+ private StringBuilder image = jjimage;
+ private int jjimageLen;
+ private int lengthOfMatch;
+ protected int curChar;
}