[Mulgara-svn] r1614 - branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog
pag at mulgara.org
pag at mulgara.org
Tue Mar 17 19:49:13 UTC 2009
Author: pag
Date: 2009-03-17 12:49:12 -0700 (Tue, 17 Mar 2009)
New Revision: 1614
Modified:
branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog/RlogParser.java
branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog/RlogParserConstants.java
branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog/RlogParserTokenManager.java
Log:
Updated with new vocab from the JavaCC file
Modified: branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog/RlogParser.java
===================================================================
--- branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog/RlogParser.java 2009-03-17 19:47:51 UTC (rev 1613)
+++ branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog/RlogParser.java 2009-03-17 19:49:12 UTC (rev 1614)
@@ -68,6 +68,7 @@
if (s != null) program.add(s);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PREFIX:
+ case IMPORT:
case IMPLIED_BY:
case INVERT:
case IDENTIFIER:
@@ -90,6 +91,10 @@
String d, ns;
Statement s;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case IMPORT:
+ importDecl();
+ {if (true) return null;}
+ break;
case PREFIX:
prefix();
{if (true) return null;}
@@ -396,6 +401,15 @@
context.registerDomain(d, ns);
}
+/* importDecl := IMPORT uri DOT */
+ final public void importDecl() throws ParseException {
+ String u;
+ jj_consume_token(IMPORT);
+ u = uri();
+ jj_consume_token(DOT);
+ program.addImport(u);
+ }
+
/* dom ::= DOMAIN */
final public String dom() throws ParseException {
Token d;
@@ -433,31 +447,6 @@
finally { jj_save(2, xla); }
}
- final private boolean jj_3R_26() {
- if (jj_scan_token(STRING_LITERAL)) return true;
- return false;
- }
-
- final private boolean jj_3R_25() {
- if (jj_scan_token(INTEGER_LITERAL)) return true;
- return false;
- }
-
- final private boolean jj_3R_24() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_25()) {
- jj_scanpos = xsp;
- if (jj_3R_26()) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_12() {
- if (jj_3R_9()) return true;
- return false;
- }
-
final private boolean jj_3R_7() {
Token xsp;
xsp = jj_scanpos;
@@ -510,6 +499,11 @@
return false;
}
+ final private boolean jj_3R_9() {
+ if (jj_scan_token(DOMAIN)) return true;
+ return false;
+ }
+
final private boolean jj_3R_6() {
Token xsp;
xsp = jj_scanpos;
@@ -551,11 +545,6 @@
return false;
}
- final private boolean jj_3R_9() {
- if (jj_scan_token(DOMAIN)) return true;
- return false;
- }
-
final private boolean jj_3_3() {
Token xsp;
xsp = jj_scanpos;
@@ -634,6 +623,31 @@
return false;
}
+ final private boolean jj_3R_26() {
+ if (jj_scan_token(STRING_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_25() {
+ if (jj_scan_token(INTEGER_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_24() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_25()) {
+ jj_scanpos = xsp;
+ if (jj_3R_26()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_12() {
+ if (jj_3R_9()) return true;
+ return false;
+ }
+
public RlogParserTokenManager token_source;
SimpleCharStream jj_input_stream;
public Token token, jj_nt;
@@ -649,7 +663,7 @@
jj_la1_0();
}
private static void jj_la1_0() {
- jj_la1_0 = new int[] {0x5c06100,0x5c06000,0x5c06100,0x5c06000,0x4c04000,0x4000000,0x5800000,0x4000000,0x4c00000,0x4000000,0x4000000,0x5800000,0x7d00000,0x2100000,0x20000,};
+ jj_la1_0 = new int[] {0xb80c300,0xb80c000,0xb80c300,0xb80c000,0x9808000,0x8000000,0xb000000,0x8000000,0x9800000,0x8000000,0x8000000,0xb000000,0xfa00000,0x4200000,0x40000,};
}
final private JJCalls[] jj_2_rtns = new JJCalls[3];
private boolean jj_rescan = false;
@@ -826,8 +840,8 @@
public ParseException generateParseException() {
jj_expentries.removeAllElements();
- boolean[] la1tokens = new boolean[27];
- for (int i = 0; i < 27; i++) {
+ boolean[] la1tokens = new boolean[28];
+ for (int i = 0; i < 28; i++) {
la1tokens[i] = false;
}
if (jj_kind >= 0) {
@@ -843,7 +857,7 @@
}
}
}
- for (int i = 0; i < 27; i++) {
+ for (int i = 0; i < 28; i++) {
if (la1tokens[i]) {
jj_expentry = new int[1];
jj_expentry[0] = i;
Modified: branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog/RlogParserConstants.java
===================================================================
--- branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog/RlogParserConstants.java 2009-03-17 19:47:51 UTC (rev 1613)
+++ branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog/RlogParserConstants.java 2009-03-17 19:49:12 UTC (rev 1614)
@@ -6,24 +6,25 @@
int EOF = 0;
int COMMENT = 7;
int PREFIX = 8;
- int LOWER_CASE_LETTER = 9;
- int UPPER_CASE_LETTER = 10;
- int DIGIT = 11;
- int J_LETTER_DIGIT = 12;
- int IMPLIED_BY = 13;
- int INVERT = 14;
- int NEGATE = 15;
- int DOT = 16;
- int COMMA = 17;
- int LPAR = 18;
- int RPAR = 19;
- int STRING_LITERAL = 20;
- int URI = 21;
- int IDENTIFIER = 22;
- int VARIABLE = 23;
- int TYPE = 24;
- int INTEGER_LITERAL = 25;
- int DOMAIN = 26;
+ int IMPORT = 9;
+ int LOWER_CASE_LETTER = 10;
+ int UPPER_CASE_LETTER = 11;
+ int DIGIT = 12;
+ int J_LETTER_DIGIT = 13;
+ int IMPLIED_BY = 14;
+ int INVERT = 15;
+ int NEGATE = 16;
+ int DOT = 17;
+ int COMMA = 18;
+ int LPAR = 19;
+ int RPAR = 20;
+ int STRING_LITERAL = 21;
+ int URI = 22;
+ int IDENTIFIER = 23;
+ int VARIABLE = 24;
+ int TYPE = 25;
+ int INTEGER_LITERAL = 26;
+ int DOMAIN = 27;
int DEFAULT = 0;
int IN_COMMENT = 1;
@@ -38,6 +39,7 @@
"\"--\"",
"<COMMENT>",
"\"@prefix\"",
+ "\"@import\"",
"<LOWER_CASE_LETTER>",
"<UPPER_CASE_LETTER>",
"<DIGIT>",
Modified: branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog/RlogParserTokenManager.java
===================================================================
--- branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog/RlogParserTokenManager.java 2009-03-17 19:47:51 UTC (rev 1613)
+++ branches/consistency/src/jar/content-rlog/javacc/org/mulgara/krule/rlog/RlogParserTokenManager.java 2009-03-17 19:49:12 UTC (rev 1614)
@@ -23,53 +23,71 @@
{
public java.io.PrintStream debugStream = System.out;
public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
+private final int jjStopStringLiteralDfa_0(int pos, long active0)
+{
+ switch (pos)
+ {
+ case 0:
+ if ((active0 & 0x4000L) != 0L)
+ {
+ jjmatchedKind = 27;
+ return -1;
+ }
+ return -1;
+ case 1:
+ if ((active0 & 0x4000L) != 0L)
+ {
+ if (jjmatchedPos == 0)
+ {
+ jjmatchedKind = 27;
+ jjmatchedPos = 0;
+ }
+ return -1;
+ }
+ return -1;
+ default :
+ return -1;
+ }
+}
+private final int jjStartNfa_0(int pos, long active0)
+{
+ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
+}
private final int jjStopAtPos(int pos, int kind)
{
jjmatchedKind = kind;
jjmatchedPos = pos;
return pos + 1;
}
+private final int jjStartNfaWithStates_0(int pos, int kind, int state)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return pos + 1; }
+ return jjMoveNfa_0(state, pos + 1);
+}
private final int jjMoveStringLiteralDfa0_0()
{
switch(curChar)
{
- case 9:
- jjmatchedKind = 1;
- return jjMoveNfa_0(0, 0);
- case 10:
- jjmatchedKind = 2;
- return jjMoveNfa_0(0, 0);
- case 12:
- jjmatchedKind = 4;
- return jjMoveNfa_0(0, 0);
- case 13:
- jjmatchedKind = 3;
- return jjMoveNfa_0(0, 0);
- case 32:
- jjmatchedKind = 5;
- return jjMoveNfa_0(0, 0);
case 40:
- jjmatchedKind = 18;
- return jjMoveNfa_0(0, 0);
+ return jjStopAtPos(0, 19);
case 41:
- jjmatchedKind = 19;
- return jjMoveNfa_0(0, 0);
+ return jjStopAtPos(0, 20);
case 44:
- jjmatchedKind = 17;
- return jjMoveNfa_0(0, 0);
+ return jjStopAtPos(0, 18);
case 45:
- jjmatchedKind = 15;
+ jjmatchedKind = 16;
return jjMoveStringLiteralDfa1_0(0x40L);
case 46:
- jjmatchedKind = 16;
- return jjMoveNfa_0(0, 0);
+ return jjStopAtPos(0, 17);
case 58:
- return jjMoveStringLiteralDfa1_0(0x2000L);
+ return jjMoveStringLiteralDfa1_0(0x4000L);
case 64:
- return jjMoveStringLiteralDfa1_0(0x100L);
+ return jjMoveStringLiteralDfa1_0(0x300L);
case 126:
- jjmatchedKind = 14;
- return jjMoveNfa_0(0, 0);
+ return jjStopAtPos(0, 15);
default :
return jjMoveNfa_0(0, 0);
}
@@ -78,135 +96,129 @@
{
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- return jjMoveNfa_0(0, 0);
+ jjStopStringLiteralDfa_0(0, active0);
+ return 1;
}
switch(curChar)
{
case 45:
if ((active0 & 0x40L) != 0L)
- {
- jjmatchedKind = 6;
- jjmatchedPos = 1;
- }
- else if ((active0 & 0x2000L) != 0L)
- {
- jjmatchedKind = 13;
- jjmatchedPos = 1;
- }
+ return jjStopAtPos(1, 6);
+ else if ((active0 & 0x4000L) != 0L)
+ return jjStopAtPos(1, 14);
break;
- case 80:
- return jjMoveStringLiteralDfa2_0(active0, 0x100L);
+ case 105:
+ return jjMoveStringLiteralDfa2_0(active0, 0x200L);
case 112:
return jjMoveStringLiteralDfa2_0(active0, 0x100L);
default :
break;
}
- return jjMoveNfa_0(0, 1);
+ return jjStartNfa_0(0, active0);
}
private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjMoveNfa_0(0, 1);
+ return jjStartNfa_0(0, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- return jjMoveNfa_0(0, 1);
+ jjStopStringLiteralDfa_0(1, active0);
+ return 2;
}
switch(curChar)
{
- case 82:
- return jjMoveStringLiteralDfa3_0(active0, 0x100L);
+ case 109:
+ return jjMoveStringLiteralDfa3_0(active0, 0x200L);
case 114:
return jjMoveStringLiteralDfa3_0(active0, 0x100L);
default :
break;
}
- return jjMoveNfa_0(0, 2);
+ return jjStartNfa_0(1, active0);
}
private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjMoveNfa_0(0, 2);
+ return jjStartNfa_0(1, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- return jjMoveNfa_0(0, 2);
+ jjStopStringLiteralDfa_0(2, active0);
+ return 3;
}
switch(curChar)
{
- case 69:
- return jjMoveStringLiteralDfa4_0(active0, 0x100L);
case 101:
return jjMoveStringLiteralDfa4_0(active0, 0x100L);
+ case 112:
+ return jjMoveStringLiteralDfa4_0(active0, 0x200L);
default :
break;
}
- return jjMoveNfa_0(0, 3);
+ return jjStartNfa_0(2, active0);
}
private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjMoveNfa_0(0, 3);
+ return jjStartNfa_0(2, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- return jjMoveNfa_0(0, 3);
+ jjStopStringLiteralDfa_0(3, active0);
+ return 4;
}
switch(curChar)
{
- case 70:
- return jjMoveStringLiteralDfa5_0(active0, 0x100L);
case 102:
return jjMoveStringLiteralDfa5_0(active0, 0x100L);
+ case 111:
+ return jjMoveStringLiteralDfa5_0(active0, 0x200L);
default :
break;
}
- return jjMoveNfa_0(0, 4);
+ return jjStartNfa_0(3, active0);
}
private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjMoveNfa_0(0, 4);
+ return jjStartNfa_0(3, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- return jjMoveNfa_0(0, 4);
+ jjStopStringLiteralDfa_0(4, active0);
+ return 5;
}
switch(curChar)
{
- case 73:
- return jjMoveStringLiteralDfa6_0(active0, 0x100L);
case 105:
return jjMoveStringLiteralDfa6_0(active0, 0x100L);
+ case 114:
+ return jjMoveStringLiteralDfa6_0(active0, 0x200L);
default :
break;
}
- return jjMoveNfa_0(0, 5);
+ return jjStartNfa_0(4, active0);
}
private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjMoveNfa_0(0, 5);
+ return jjStartNfa_0(4, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- return jjMoveNfa_0(0, 5);
+ jjStopStringLiteralDfa_0(5, active0);
+ return 6;
}
switch(curChar)
{
- case 88:
- if ((active0 & 0x100L) != 0L)
- {
- jjmatchedKind = 8;
- jjmatchedPos = 6;
- }
+ case 116:
+ if ((active0 & 0x200L) != 0L)
+ return jjStopAtPos(6, 9);
break;
case 120:
if ((active0 & 0x100L) != 0L)
- {
- jjmatchedKind = 8;
- jjmatchedPos = 6;
- }
+ return jjStopAtPos(6, 8);
break;
default :
break;
}
- return jjMoveNfa_0(0, 6);
+ return jjStartNfa_0(5, active0);
}
private final void jjCheckNAdd(int state)
{
@@ -246,13 +258,6 @@
};
private final int jjMoveNfa_0(int startState, int curPos)
{
- int strKind = jjmatchedKind;
- int strPos = jjmatchedPos;
- int seenUpto;
- input_stream.backup(seenUpto = curPos + 1);
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) { throw new Error("Internal Error"); }
- curPos = 0;
int[] nextStates;
int startsAt = 0;
jjnewStateCnt = 21;
@@ -273,19 +278,19 @@
case 0:
if ((0x3fe000000000000L & l) != 0L)
{
- if (kind > 25)
- kind = 25;
+ if (kind > 26)
+ kind = 26;
jjCheckNAdd(14);
}
else if (curChar == 58)
{
- if (kind > 26)
- kind = 26;
+ if (kind > 27)
+ kind = 27;
}
else if (curChar == 48)
{
- if (kind > 25)
- kind = 25;
+ if (kind > 26)
+ kind = 26;
}
else if (curChar == 60)
jjCheckNAddTwoStates(10, 11);
@@ -301,8 +306,8 @@
jjCheckNAddStates(0, 2);
break;
case 4:
- if (curChar == 34 && kind > 20)
- kind = 20;
+ if (curChar == 34 && kind > 21)
+ kind = 21;
break;
case 5:
if ((0xff000000000000L & l) != 0L)
@@ -329,43 +334,43 @@
jjCheckNAddTwoStates(10, 11);
break;
case 11:
- if (curChar == 62 && kind > 21)
- kind = 21;
+ if (curChar == 62 && kind > 22)
+ kind = 22;
break;
case 12:
- if (curChar == 48 && kind > 25)
- kind = 25;
+ if (curChar == 48 && kind > 26)
+ kind = 26;
break;
case 13:
if ((0x3fe000000000000L & l) == 0L)
break;
- if (kind > 25)
- kind = 25;
+ if (kind > 26)
+ kind = 26;
jjCheckNAdd(14);
break;
case 14:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 25)
- kind = 25;
+ if (kind > 26)
+ kind = 26;
jjCheckNAdd(14);
break;
case 15:
- if (curChar == 58 && kind > 26)
- kind = 26;
+ if (curChar == 58 && kind > 27)
+ kind = 27;
break;
case 17:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 22)
- kind = 22;
+ if (kind > 23)
+ kind = 23;
jjstateSet[jjnewStateCnt++] = 17;
break;
case 20:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 24)
- kind = 24;
+ if (kind > 25)
+ kind = 25;
jjstateSet[jjnewStateCnt++] = 20;
break;
default : break;
@@ -382,14 +387,14 @@
case 0:
if ((0x7fffffeL & l) != 0L)
{
- if (kind > 23)
- kind = 23;
+ if (kind > 24)
+ kind = 24;
jjCheckNAdd(20);
}
else if ((0x7fffffe00000000L & l) != 0L)
{
- if (kind > 22)
- kind = 22;
+ if (kind > 23)
+ kind = 23;
jjCheckNAddStates(7, 9);
}
break;
@@ -411,15 +416,15 @@
case 16:
if ((0x7fffffe00000000L & l) == 0L)
break;
- if (kind > 22)
- kind = 22;
+ if (kind > 23)
+ kind = 23;
jjCheckNAddStates(7, 9);
break;
case 17:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
- if (kind > 22)
- kind = 22;
+ if (kind > 23)
+ kind = 23;
jjCheckNAdd(17);
break;
case 18:
@@ -429,15 +434,15 @@
case 19:
if ((0x7fffffeL & l) == 0L)
break;
- if (kind > 23)
- kind = 23;
+ if (kind > 24)
+ kind = 24;
jjCheckNAdd(20);
break;
case 20:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
- if (kind > 24)
- kind = 24;
+ if (kind > 25)
+ kind = 25;
jjCheckNAdd(20);
break;
default : break;
@@ -475,29 +480,10 @@
}
++curPos;
if ((i = jjnewStateCnt) == (startsAt = 21 - (jjnewStateCnt = startsAt)))
- break;
+ return curPos;
try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) { break; }
+ catch(java.io.IOException e) { return curPos; }
}
- if (jjmatchedPos > strPos)
- return curPos;
-
- int toRet = Math.max(curPos, seenUpto);
-
- if (curPos < toRet)
- for (i = toRet - Math.min(curPos, seenUpto); i-- > 0; )
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) { throw new Error("Internal Error : Please send a bug report."); }
-
- if (jjmatchedPos < strPos)
- {
- jjmatchedKind = strKind;
- jjmatchedPos = strPos;
- }
- else if (jjmatchedPos == strPos && jjmatchedKind > strKind)
- jjmatchedKind = strKind;
-
- return toRet;
}
private final int jjMoveStringLiteralDfa0_1()
{
@@ -598,19 +584,19 @@
}
}
public static final String[] jjstrLiteralImages = {
-"", null, null, null, null, null, null, null, null, null, null, null, null,
-"\72\55", "\176", "\55", "\56", "\54", "\50", "\51", null, null, null, null, null, null,
-null, };
+"", null, null, null, null, null, null, null, "\100\160\162\145\146\151\170",
+"\100\151\155\160\157\162\164", null, null, null, null, "\72\55", "\176", "\55", "\56", "\54", "\50", "\51",
+null, null, null, null, null, null, null, };
public static final String[] lexStateNames = {
"DEFAULT",
"IN_COMMENT",
};
public static final int[] jjnewLexState = {
-1, -1, -1, -1, -1, -1, 1, 0, -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 = {
- 0x7ffe101L,
+ 0xfffc301L,
};
static final long[] jjtoSkip = {
0xbeL,
@@ -725,6 +711,11 @@
switch(curLexState)
{
case 0:
+ try { input_stream.backup(0);
+ while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L)
+ curChar = input_stream.BeginToken();
+ }
+ catch (java.io.IOException e1) { continue EOFLoop; }
jjmatchedKind = 0x7fffffff;
jjmatchedPos = 0;
curPos = jjMoveStringLiteralDfa0_0();
More information about the Mulgara-svn
mailing list