You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by en...@apache.org on 2011/04/01 14:47:56 UTC
svn commit: r1087688 [7/19] - in /incubator/stanbol/trunk/rules: ./ base/
base/.settings/ base/src/ base/src/main/ base/src/main/java/
base/src/main/java/org/ base/src/main/java/org/apache/
base/src/main/java/org/apache/stanbol/ base/src/main/java/org/...
Added: incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserTokenManager.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserTokenManager.java?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserTokenManager.java (added)
+++ incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserTokenManager.java Fri Apr 1 12:47:48 2011
@@ -0,0 +1,998 @@
+/* Generated By:JavaCC: Do not edit this line. RuleParserTokenManager.java */
+package org.apache.stanbol.rules.manager.parse;
+
+/** Token Manager. */
+public class RuleParserTokenManager implements RuleParserConstants
+{
+
+ /** Debug output. */
+ public java.io.PrintStream debugStream = System.out;
+ /** Set debug output. */
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
+private final int jjStopStringLiteralDfa_0(int pos, long active0)
+{
+ switch (pos)
+ {
+ case 0:
+ if ((active0 & 0x200000000000L) != 0L)
+ return 8;
+ if ((active0 & 0x100L) != 0L)
+ return 1;
+ if ((active0 & 0x3fbfffff820L) != 0L)
+ {
+ jjmatchedKind = 49;
+ return 1;
+ }
+ return -1;
+ case 1:
+ if ((active0 & 0x2000000e000L) != 0L)
+ return 1;
+ if ((active0 & 0x1fbffff1800L) != 0L)
+ {
+ if (jjmatchedPos != 1)
+ {
+ jjmatchedKind = 49;
+ jjmatchedPos = 1;
+ }
+ return 1;
+ }
+ return -1;
+ case 2:
+ if ((active0 & 0x27a840000L) != 0L)
+ return 1;
+ if ((active0 & 0x3f9857b1800L) != 0L)
+ {
+ if (jjmatchedPos != 2)
+ {
+ jjmatchedKind = 49;
+ jjmatchedPos = 2;
+ }
+ return 1;
+ }
+ return -1;
+ case 3:
+ if ((active0 & 0x10000000800L) != 0L)
+ return 1;
+ if ((active0 & 0x2f98d7f1000L) != 0L)
+ {
+ jjmatchedKind = 49;
+ jjmatchedPos = 3;
+ return 1;
+ }
+ return -1;
+ case 4:
+ if ((active0 & 0x808000000L) != 0L)
+ return 1;
+ if ((active0 & 0x2f1857f1000L) != 0L)
+ {
+ jjmatchedKind = 49;
+ jjmatchedPos = 4;
+ return 1;
+ }
+ return -1;
+ case 5:
+ if ((active0 & 0x2f1807d1000L) != 0L)
+ {
+ jjmatchedKind = 49;
+ jjmatchedPos = 5;
+ return 1;
+ }
+ if ((active0 & 0x5020000L) != 0L)
+ return 1;
+ return -1;
+ case 6:
+ if ((active0 & 0xf1807c1000L) != 0L)
+ {
+ jjmatchedKind = 49;
+ jjmatchedPos = 6;
+ return 1;
+ }
+ if ((active0 & 0x20000010000L) != 0L)
+ return 1;
+ return -1;
+ case 7:
+ if ((active0 & 0x11803c1000L) != 0L)
+ {
+ if (jjmatchedPos != 7)
+ {
+ jjmatchedKind = 49;
+ jjmatchedPos = 7;
+ }
+ return 1;
+ }
+ if ((active0 & 0xe000400000L) != 0L)
+ return 1;
+ return -1;
+ case 8:
+ if ((active0 & 0x1000200000L) != 0L)
+ {
+ jjmatchedKind = 49;
+ jjmatchedPos = 8;
+ return 1;
+ }
+ if ((active0 & 0x81801c1000L) != 0L)
+ return 1;
+ return -1;
+ case 9:
+ if ((active0 & 0x1000000000L) != 0L)
+ {
+ jjmatchedKind = 49;
+ jjmatchedPos = 9;
+ return 1;
+ }
+ if ((active0 & 0x200000L) != 0L)
+ 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 int jjStopAtPos(int pos, int kind)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ return pos + 1;
+}
+private int jjMoveStringLiteralDfa0_0()
+{
+ switch(curChar)
+ {
+ case 33:
+ return jjStopAtPos(0, 42);
+ case 34:
+ return jjStartNfaWithStates_0(0, 45, 8);
+ case 40:
+ return jjStopAtPos(0, 43);
+ case 41:
+ return jjStopAtPos(0, 44);
+ case 43:
+ return jjStopAtPos(0, 10);
+ case 44:
+ return jjStopAtPos(0, 9);
+ case 45:
+ return jjMoveStringLiteralDfa1_0(0x20L);
+ case 46:
+ return jjStartNfaWithStates_0(0, 8, 1);
+ case 58:
+ return jjStopAtPos(0, 6);
+ case 61:
+ return jjStopAtPos(0, 7);
+ case 91:
+ return jjStopAtPos(0, 46);
+ case 93:
+ return jjStopAtPos(0, 47);
+ case 94:
+ return jjStopAtPos(0, 34);
+ case 99:
+ return jjMoveStringLiteralDfa1_0(0x1001000000L);
+ case 100:
+ return jjMoveStringLiteralDfa1_0(0x1000L);
+ case 101:
+ return jjMoveStringLiteralDfa1_0(0x400000L);
+ case 103:
+ return jjMoveStringLiteralDfa1_0(0x4000L);
+ case 104:
+ return jjMoveStringLiteralDfa1_0(0x2000000L);
+ case 105:
+ return jjMoveStringLiteralDfa1_0(0x20000008000L);
+ case 108:
+ return jjMoveStringLiteralDfa1_0(0x100922000L);
+ case 110:
+ return jjMoveStringLiteralDfa1_0(0xc8010000L);
+ case 112:
+ return jjMoveStringLiteralDfa1_0(0x10000000000L);
+ case 115:
+ return jjMoveStringLiteralDfa1_0(0xe230240800L);
+ case 117:
+ return jjMoveStringLiteralDfa1_0(0x800080000L);
+ case 118:
+ return jjMoveStringLiteralDfa1_0(0x4000000L);
+ default :
+ return jjMoveNfa_0(2, 0);
+ }
+}
+private int jjMoveStringLiteralDfa1_0(long active0)
+{
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(0, active0);
+ return 1;
+ }
+ switch(curChar)
+ {
+ case 62:
+ if ((active0 & 0x20L) != 0L)
+ return jjStopAtPos(1, 5);
+ break;
+ case 97:
+ return jjMoveStringLiteralDfa2_0(active0, 0x86000800L);
+ case 101:
+ return jjMoveStringLiteralDfa2_0(active0, 0x830000L);
+ case 105:
+ return jjMoveStringLiteralDfa2_0(active0, 0x1000L);
+ case 110:
+ return jjMoveStringLiteralDfa2_0(active0, 0x800400000L);
+ case 111:
+ return jjMoveStringLiteralDfa2_0(active0, 0x149100000L);
+ case 112:
+ return jjMoveStringLiteralDfa2_0(active0, 0xe000080000L);
+ case 114:
+ return jjMoveStringLiteralDfa2_0(active0, 0x11000000000L);
+ case 115:
+ if ((active0 & 0x8000L) != 0L)
+ {
+ jjmatchedKind = 15;
+ jjmatchedPos = 1;
+ }
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000000000L);
+ case 116:
+ if ((active0 & 0x2000L) != 0L)
+ return jjStartNfaWithStates_0(1, 13, 1);
+ else if ((active0 & 0x4000L) != 0L)
+ return jjStartNfaWithStates_0(1, 14, 1);
+ return jjMoveStringLiteralDfa2_0(active0, 0x200200000L);
+ case 117:
+ return jjMoveStringLiteralDfa2_0(active0, 0x30040000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(0, active0);
+}
+private int jjMoveStringLiteralDfa2_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(0, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(1, active0);
+ return 2;
+ }
+ switch(curChar)
+ {
+ case 66:
+ return jjMoveStringLiteralDfa3_0(active0, 0x20000000000L);
+ case 97:
+ return jjMoveStringLiteralDfa3_0(active0, 0xe000200000L);
+ case 98:
+ if ((active0 & 0x20000000L) != 0L)
+ {
+ jjmatchedKind = 29;
+ jjmatchedPos = 2;
+ }
+ return jjMoveStringLiteralDfa3_0(active0, 0x40000L);
+ case 99:
+ return jjMoveStringLiteralDfa3_0(active0, 0x100000000L);
+ case 100:
+ return jjMoveStringLiteralDfa3_0(active0, 0x400000L);
+ case 101:
+ return jjMoveStringLiteralDfa3_0(active0, 0x1000000000L);
+ case 102:
+ return jjMoveStringLiteralDfa3_0(active0, 0x1000L);
+ case 105:
+ return jjMoveStringLiteralDfa3_0(active0, 0x800000000L);
+ case 108:
+ return jjMoveStringLiteralDfa3_0(active0, 0x4000000L);
+ case 109:
+ if ((active0 & 0x10000000L) != 0L)
+ return jjStartNfaWithStates_0(2, 28, 1);
+ return jjMoveStringLiteralDfa3_0(active0, 0x80000800L);
+ case 110:
+ return jjMoveStringLiteralDfa3_0(active0, 0x1020000L);
+ case 111:
+ return jjMoveStringLiteralDfa3_0(active0, 0x10000000000L);
+ case 112:
+ return jjMoveStringLiteralDfa3_0(active0, 0x80000L);
+ case 114:
+ if ((active0 & 0x200000000L) != 0L)
+ return jjStartNfaWithStates_0(2, 33, 1);
+ break;
+ case 115:
+ if ((active0 & 0x2000000L) != 0L)
+ return jjStartNfaWithStates_0(2, 25, 1);
+ break;
+ case 116:
+ if ((active0 & 0x800000L) != 0L)
+ return jjStartNfaWithStates_0(2, 23, 1);
+ else if ((active0 & 0x40000000L) != 0L)
+ {
+ jjmatchedKind = 30;
+ jjmatchedPos = 2;
+ }
+ return jjMoveStringLiteralDfa3_0(active0, 0x8000000L);
+ case 119:
+ return jjMoveStringLiteralDfa3_0(active0, 0x110000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(1, active0);
+}
+private int jjMoveStringLiteralDfa3_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(1, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(2, active0);
+ return 3;
+ }
+ switch(curChar)
+ {
+ case 78:
+ return jjMoveStringLiteralDfa4_0(active0, 0x10000L);
+ case 97:
+ return jjMoveStringLiteralDfa4_0(active0, 0x1100000000L);
+ case 99:
+ return jjMoveStringLiteralDfa4_0(active0, 0x1000000L);
+ case 101:
+ if ((active0 & 0x800L) != 0L)
+ return jjStartNfaWithStates_0(3, 11, 1);
+ return jjMoveStringLiteralDfa4_0(active0, 0x88180000L);
+ case 102:
+ return jjMoveStringLiteralDfa4_0(active0, 0x1000L);
+ case 103:
+ return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
+ case 108:
+ return jjMoveStringLiteralDfa4_0(active0, 0x20000000000L);
+ case 111:
+ return jjMoveStringLiteralDfa4_0(active0, 0x800000000L);
+ case 112:
+ if ((active0 & 0x10000000000L) != 0L)
+ return jjStartNfaWithStates_0(3, 40, 1);
+ break;
+ case 114:
+ return jjMoveStringLiteralDfa4_0(active0, 0xe000200000L);
+ case 115:
+ return jjMoveStringLiteralDfa4_0(active0, 0x440000L);
+ case 117:
+ return jjMoveStringLiteralDfa4_0(active0, 0x4000000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(2, active0);
+}
+private int jjMoveStringLiteralDfa4_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(2, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(3, active0);
+ return 4;
+ }
+ switch(curChar)
+ {
+ case 87:
+ return jjMoveStringLiteralDfa5_0(active0, 0x400000L);
+ case 97:
+ return jjMoveStringLiteralDfa5_0(active0, 0x20001000000L);
+ case 101:
+ return jjMoveStringLiteralDfa5_0(active0, 0x4001000L);
+ case 108:
+ return jjMoveStringLiteralDfa5_0(active0, 0x100000000L);
+ case 110:
+ if ((active0 & 0x800000000L) != 0L)
+ return jjStartNfaWithStates_0(4, 35, 1);
+ break;
+ case 111:
+ return jjMoveStringLiteralDfa5_0(active0, 0x10000L);
+ case 113:
+ return jjMoveStringLiteralDfa5_0(active0, 0xe000000000L);
+ case 114:
+ return jjMoveStringLiteralDfa5_0(active0, 0x180000L);
+ case 115:
+ return jjMoveStringLiteralDfa5_0(active0, 0x80000000L);
+ case 116:
+ return jjMoveStringLiteralDfa5_0(active0, 0x1000260000L);
+ case 120:
+ if ((active0 & 0x8000000L) != 0L)
+ return jjStartNfaWithStates_0(4, 27, 1);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(3, active0);
+}
+private int jjMoveStringLiteralDfa5_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(3, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(4, active0);
+ return 5;
+ }
+ switch(curChar)
+ {
+ case 67:
+ return jjMoveStringLiteralDfa6_0(active0, 0x180000L);
+ case 100:
+ return jjMoveStringLiteralDfa6_0(active0, 0x10000L);
+ case 101:
+ return jjMoveStringLiteralDfa6_0(active0, 0x1000000000L);
+ case 104:
+ if ((active0 & 0x20000L) != 0L)
+ return jjStartNfaWithStates_0(5, 17, 1);
+ break;
+ case 105:
+ return jjMoveStringLiteralDfa6_0(active0, 0x400000L);
+ case 108:
+ return jjMoveStringLiteralDfa6_0(active0, 0xe000000000L);
+ case 110:
+ return jjMoveStringLiteralDfa6_0(active0, 0x20100000000L);
+ case 112:
+ return jjMoveStringLiteralDfa6_0(active0, 0x80000000L);
+ case 114:
+ return jjMoveStringLiteralDfa6_0(active0, 0x41000L);
+ case 115:
+ if ((active0 & 0x4000000L) != 0L)
+ return jjStartNfaWithStates_0(5, 26, 1);
+ return jjMoveStringLiteralDfa6_0(active0, 0x200000L);
+ case 116:
+ if ((active0 & 0x1000000L) != 0L)
+ return jjStartNfaWithStates_0(5, 24, 1);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(4, active0);
+}
+private int jjMoveStringLiteralDfa6_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(4, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(5, active0);
+ return 6;
+ }
+ switch(curChar)
+ {
+ case 45:
+ return jjMoveStringLiteralDfa7_0(active0, 0xe000000000L);
+ case 76:
+ return jjMoveStringLiteralDfa7_0(active0, 0x1000000000L);
+ case 87:
+ return jjMoveStringLiteralDfa7_0(active0, 0x200000L);
+ case 97:
+ return jjMoveStringLiteralDfa7_0(active0, 0x180180000L);
+ case 101:
+ if ((active0 & 0x10000L) != 0L)
+ return jjStartNfaWithStates_0(6, 16, 1);
+ return jjMoveStringLiteralDfa7_0(active0, 0x1000L);
+ case 105:
+ return jjMoveStringLiteralDfa7_0(active0, 0x40000L);
+ case 107:
+ if ((active0 & 0x20000000000L) != 0L)
+ return jjStartNfaWithStates_0(6, 41, 1);
+ break;
+ case 116:
+ return jjMoveStringLiteralDfa7_0(active0, 0x400000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(5, active0);
+}
+private int jjMoveStringLiteralDfa7_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(5, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(6, active0);
+ return 7;
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa8_0(active0, 0x1000000000L);
+ case 99:
+ if ((active0 & 0x2000000000L) != 0L)
+ return jjStartNfaWithStates_0(7, 37, 1);
+ return jjMoveStringLiteralDfa8_0(active0, 0x80000000L);
+ case 100:
+ if ((active0 & 0x4000000000L) != 0L)
+ {
+ jjmatchedKind = 38;
+ jjmatchedPos = 7;
+ }
+ return jjMoveStringLiteralDfa8_0(active0, 0x8000000000L);
+ case 104:
+ if ((active0 & 0x400000L) != 0L)
+ return jjStartNfaWithStates_0(7, 22, 1);
+ break;
+ case 105:
+ return jjMoveStringLiteralDfa8_0(active0, 0x200000L);
+ case 109:
+ return jjMoveStringLiteralDfa8_0(active0, 0x100000000L);
+ case 110:
+ return jjMoveStringLiteralDfa8_0(active0, 0x41000L);
+ case 115:
+ return jjMoveStringLiteralDfa8_0(active0, 0x180000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(6, active0);
+}
+private int jjMoveStringLiteralDfa8_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(6, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(7, active0);
+ return 8;
+ }
+ switch(curChar)
+ {
+ case 98:
+ return jjMoveStringLiteralDfa9_0(active0, 0x1000000000L);
+ case 100:
+ if ((active0 & 0x8000000000L) != 0L)
+ return jjStartNfaWithStates_0(8, 39, 1);
+ break;
+ case 101:
+ if ((active0 & 0x80000L) != 0L)
+ return jjStartNfaWithStates_0(8, 19, 1);
+ else if ((active0 & 0x100000L) != 0L)
+ return jjStartNfaWithStates_0(8, 20, 1);
+ else if ((active0 & 0x80000000L) != 0L)
+ return jjStartNfaWithStates_0(8, 31, 1);
+ else if ((active0 & 0x100000000L) != 0L)
+ return jjStartNfaWithStates_0(8, 32, 1);
+ break;
+ case 103:
+ if ((active0 & 0x40000L) != 0L)
+ return jjStartNfaWithStates_0(8, 18, 1);
+ break;
+ case 116:
+ if ((active0 & 0x1000L) != 0L)
+ return jjStartNfaWithStates_0(8, 12, 1);
+ return jjMoveStringLiteralDfa9_0(active0, 0x200000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(7, active0);
+}
+private int jjMoveStringLiteralDfa9_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(7, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(8, active0);
+ return 9;
+ }
+ switch(curChar)
+ {
+ case 101:
+ return jjMoveStringLiteralDfa10_0(active0, 0x1000000000L);
+ case 104:
+ if ((active0 & 0x200000L) != 0L)
+ return jjStartNfaWithStates_0(9, 21, 1);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(8, active0);
+}
+private int jjMoveStringLiteralDfa10_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(8, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(9, active0);
+ return 10;
+ }
+ switch(curChar)
+ {
+ case 108:
+ if ((active0 & 0x1000000000L) != 0L)
+ return jjStartNfaWithStates_0(10, 36, 1);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(9, active0);
+}
+private 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 int jjMoveNfa_0(int startState, int curPos)
+{
+ int startsAt = 0;
+ jjnewStateCnt = 16;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int kind = 0x7fffffff;
+ for (;;)
+ {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64)
+ {
+ long l = 1L << curChar;
+ do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 2:
+ if ((0x3ff600000000000L & l) != 0L)
+ {
+ if (kind > 49)
+ kind = 49;
+ jjCheckNAdd(1);
+ }
+ else if (curChar == 37)
+ jjCheckNAdd(11);
+ else if (curChar == 34)
+ jjCheckNAdd(8);
+ else if (curChar == 60)
+ jjCheckNAdd(5);
+ else if (curChar == 63)
+ jjCheckNAdd(3);
+ if ((0x3ff000000000000L & l) != 0L)
+ {
+ if (kind > 48)
+ kind = 48;
+ jjCheckNAdd(0);
+ }
+ break;
+ case 0:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 48)
+ kind = 48;
+ jjCheckNAdd(0);
+ break;
+ case 1:
+ if ((0x3ff600000000000L & l) == 0L)
+ break;
+ if (kind > 49)
+ kind = 49;
+ jjCheckNAdd(1);
+ break;
+ case 3:
+ if ((0x3ff200000000000L & l) == 0L)
+ break;
+ if (kind > 50)
+ kind = 50;
+ jjCheckNAdd(3);
+ break;
+ case 4:
+ if (curChar == 60)
+ jjCheckNAdd(5);
+ break;
+ case 5:
+ if ((0x7ffe30800000000L & l) != 0L)
+ jjCheckNAddTwoStates(5, 6);
+ break;
+ case 6:
+ if (curChar == 62 && kind > 51)
+ kind = 51;
+ break;
+ case 7:
+ if (curChar == 34)
+ jjCheckNAdd(8);
+ break;
+ case 8:
+ if ((0x87ffe03b00000000L & l) != 0L)
+ jjCheckNAddTwoStates(8, 9);
+ break;
+ case 9:
+ if (curChar == 34 && kind > 52)
+ kind = 52;
+ break;
+ case 10:
+ if (curChar == 37)
+ jjCheckNAdd(11);
+ break;
+ case 11:
+ if ((0xf7fffb7f00000600L & l) != 0L)
+ jjCheckNAddTwoStates(11, 12);
+ break;
+ case 12:
+ if (curChar == 37 && kind > 53)
+ kind = 53;
+ break;
+ case 13:
+ if (curChar == 58)
+ jjCheckNAdd(14);
+ break;
+ case 14:
+ if ((0x3ff600000000000L & l) == 0L)
+ break;
+ if (kind > 54)
+ kind = 54;
+ jjCheckNAdd(14);
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else if (curChar < 128)
+ {
+ long l = 1L << (curChar & 077);
+ do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 2:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ {
+ if (kind > 49)
+ kind = 49;
+ jjCheckNAdd(1);
+ }
+ if (curChar == 95)
+ jjstateSet[jjnewStateCnt++] = 13;
+ break;
+ case 1:
+ if ((0x7fffffe87fffffeL & l) == 0L)
+ break;
+ if (kind > 49)
+ kind = 49;
+ jjCheckNAdd(1);
+ break;
+ case 3:
+ if ((0x7fffffe87fffffeL & l) == 0L)
+ break;
+ if (kind > 50)
+ kind = 50;
+ jjstateSet[jjnewStateCnt++] = 3;
+ break;
+ case 5:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ jjAddStates(0, 1);
+ break;
+ case 8:
+ if ((0x7fffffe97fffffeL & l) != 0L)
+ jjAddStates(2, 3);
+ break;
+ case 11:
+ if ((0x3ffffffe97fffffeL & l) != 0L)
+ jjAddStates(4, 5);
+ break;
+ case 14:
+ if ((0x7fffffe87fffffeL & l) == 0L)
+ break;
+ if (kind > 54)
+ kind = 54;
+ jjstateSet[jjnewStateCnt++] = 14;
+ break;
+ case 15:
+ if (curChar == 95)
+ jjstateSet[jjnewStateCnt++] = 13;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else
+ {
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ do
+ {
+ switch(jjstateSet[--i])
+ {
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ if (kind != 0x7fffffff)
+ {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 16 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return curPos; }
+ }
+}
+static final int[] jjnextStates = {
+ 5, 6, 8, 9, 11, 12,
+};
+
+/** Token literal values. */
+public static final String[] jjstrLiteralImages = {
+"", null, null, null, null, "\55\76", "\72", "\75", "\56", "\54", "\53",
+"\163\141\155\145", "\144\151\146\146\145\162\145\156\164", "\154\164", "\147\164", "\151\163",
+"\156\145\167\116\157\144\145", "\154\145\156\147\164\150", "\163\165\142\163\164\162\151\156\147",
+"\165\160\160\145\162\103\141\163\145", "\154\157\167\145\162\103\141\163\145",
+"\163\164\141\162\164\163\127\151\164\150", "\145\156\144\163\127\151\164\150", "\154\145\164",
+"\143\157\156\143\141\164", "\150\141\163", "\166\141\154\165\145\163", "\156\157\164\145\170",
+"\163\165\155", "\163\165\142", "\156\157\164", "\156\141\155\145\163\160\141\143\145",
+"\154\157\143\141\154\156\141\155\145", "\163\164\162", "\136", "\165\156\151\157\156",
+"\143\162\145\141\164\145\114\141\142\145\154", "\163\160\141\162\161\154\55\143", "\163\160\141\162\161\154\55\144",
+"\163\160\141\162\161\154\55\144\144", "\160\162\157\160", "\151\163\102\154\141\156\153", "\41", "\50", "\51",
+"\42", "\133", "\135", null, null, null, null, null, null, null, };
+
+/** Lexer state names. */
+public static final String[] lexStateNames = {
+ "DEFAULT",
+};
+static final long[] jjtoToken = {
+ 0x7fffffffffffe1L,
+};
+static final long[] jjtoSkip = {
+ 0x1eL,
+};
+protected SimpleCharStream input_stream;
+private final int[] jjrounds = new int[16];
+private final int[] jjstateSet = new int[32];
+protected char curChar;
+/** Constructor. */
+public RuleParserTokenManager(SimpleCharStream stream){
+ if (SimpleCharStream.staticFlag)
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+ input_stream = stream;
+}
+
+/** Constructor. */
+public RuleParserTokenManager(SimpleCharStream stream, int lexState){
+ this(stream);
+ SwitchTo(lexState);
+}
+
+/** Reinitialise parser. */
+public void ReInit(SimpleCharStream stream)
+{
+ jjmatchedPos = jjnewStateCnt = 0;
+ curLexState = defaultLexState;
+ input_stream = stream;
+ ReInitRounds();
+}
+private void ReInitRounds()
+{
+ int i;
+ jjround = 0x80000001;
+ for (i = 16; i-- > 0;)
+ jjrounds[i] = 0x80000000;
+}
+
+/** Reinitialise parser. */
+public void ReInit(SimpleCharStream 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;
+int jjround;
+int jjmatchedPos;
+int jjmatchedKind;
+
+/** Get the next Token. */
+public Token getNextToken()
+{
+ Token matchedToken;
+ int curPos = 0;
+
+ EOFLoop :
+ for (;;)
+ {
+ try
+ {
+ curChar = input_stream.BeginToken();
+ }
+ catch(java.io.IOException e)
+ {
+ jjmatchedKind = 0;
+ matchedToken = jjFillToken();
+ return matchedToken;
+ }
+
+ try { input_stream.backup(0);
+ while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
+ curChar = input_stream.BeginToken();
+ }
+ catch (java.io.IOException e1) { continue EOFLoop; }
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_0();
+ if (jjmatchedKind != 0x7fffffff)
+ {
+ if (jjmatchedPos + 1 < curPos)
+ input_stream.backup(curPos - jjmatchedPos - 1);
+ if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+ {
+ matchedToken = jjFillToken();
+ return matchedToken;
+ }
+ else
+ {
+ continue EOFLoop;
+ }
+ }
+ int error_line = input_stream.getEndLine();
+ int error_column = input_stream.getEndColumn();
+ String error_after = null;
+ boolean EOFSeen = false;
+ try { input_stream.readChar(); input_stream.backup(1); }
+ catch (java.io.IOException e1) {
+ EOFSeen = true;
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ if (curChar == '\n' || curChar == '\r') {
+ error_line++;
+ error_column = 0;
+ }
+ else
+ error_column++;
+ }
+ if (!EOFSeen) {
+ input_stream.backup(1);
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ }
+ throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
+ }
+}
+
+private void jjCheckNAdd(int state)
+{
+ if (jjrounds[state] != jjround)
+ {
+ jjstateSet[jjnewStateCnt++] = state;
+ jjrounds[state] = jjround;
+ }
+}
+private void jjAddStates(int start, int end)
+{
+ do {
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+ } while (start++ != end);
+}
+private void jjCheckNAddTwoStates(int state1, int state2)
+{
+ jjCheckNAdd(state1);
+ jjCheckNAdd(state2);
+}
+
+}
Added: incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/SimpleCharStream.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/SimpleCharStream.java?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/SimpleCharStream.java (added)
+++ incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/SimpleCharStream.java Fri Apr 1 12:47:48 2011
@@ -0,0 +1,471 @@
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */
+/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
+package org.apache.stanbol.rules.manager.parse;
+
+/**
+ * An implementation of interface CharStream, where the stream is assumed to
+ * contain only ASCII characters (without unicode processing).
+ */
+
+public class SimpleCharStream
+{
+/** Whether parser is static. */
+ public static final boolean staticFlag = false;
+ int bufsize;
+ int available;
+ int tokenBegin;
+/** Position in buffer. */
+ public int bufpos = -1;
+ protected int bufline[];
+ protected int bufcolumn[];
+
+ protected int column = 0;
+ protected int line = 1;
+
+ protected boolean prevCharIsCR = false;
+ protected boolean prevCharIsLF = false;
+
+ protected java.io.Reader inputStream;
+
+ protected char[] buffer;
+ protected int maxNextCharInd = 0;
+ protected int inBuf = 0;
+ protected int tabSize = 8;
+
+ protected void setTabSize(int i) { tabSize = i; }
+ protected int getTabSize(int i) { return tabSize; }
+
+
+ protected void ExpandBuff(boolean wrapAround)
+ {
+ char[] newbuffer = new char[bufsize + 2048];
+ int newbufline[] = new int[bufsize + 2048];
+ int newbufcolumn[] = new int[bufsize + 2048];
+
+ try
+ {
+ if (wrapAround)
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos += (bufsize - tokenBegin));
+ }
+ else
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos -= tokenBegin);
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new Error(t.getMessage());
+ }
+
+
+ bufsize += 2048;
+ available = bufsize;
+ tokenBegin = 0;
+ }
+
+ protected void FillBuff() throws java.io.IOException
+ {
+ if (maxNextCharInd == available)
+ {
+ if (available == bufsize)
+ {
+ if (tokenBegin > 2048)
+ {
+ bufpos = maxNextCharInd = 0;
+ available = tokenBegin;
+ }
+ else if (tokenBegin < 0)
+ bufpos = maxNextCharInd = 0;
+ else
+ ExpandBuff(false);
+ }
+ else if (available > tokenBegin)
+ available = bufsize;
+ else if ((tokenBegin - available) < 2048)
+ ExpandBuff(true);
+ else
+ available = tokenBegin;
+ }
+
+ int i;
+ try {
+ if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1)
+ {
+ inputStream.close();
+ throw new java.io.IOException();
+ }
+ else
+ maxNextCharInd += i;
+ return;
+ }
+ catch(java.io.IOException e) {
+ --bufpos;
+ backup(0);
+ if (tokenBegin == -1)
+ tokenBegin = bufpos;
+ throw e;
+ }
+ }
+
+/** Start. */
+ public char BeginToken() throws java.io.IOException
+ {
+ tokenBegin = -1;
+ char c = readChar();
+ tokenBegin = bufpos;
+
+ return c;
+ }
+
+ protected void UpdateLineColumn(char c)
+ {
+ column++;
+
+ if (prevCharIsLF)
+ {
+ prevCharIsLF = false;
+ line += (column = 1);
+ }
+ else if (prevCharIsCR)
+ {
+ prevCharIsCR = false;
+ if (c == '\n')
+ {
+ prevCharIsLF = true;
+ }
+ else
+ line += (column = 1);
+ }
+
+ switch (c)
+ {
+ case '\r' :
+ prevCharIsCR = true;
+ break;
+ case '\n' :
+ prevCharIsLF = true;
+ break;
+ case '\t' :
+ column--;
+ column += (tabSize - (column % tabSize));
+ break;
+ default :
+ break;
+ }
+
+ bufline[bufpos] = line;
+ bufcolumn[bufpos] = column;
+ }
+
+/** Read a character. */
+ public char readChar() throws java.io.IOException
+ {
+ if (inBuf > 0)
+ {
+ --inBuf;
+
+ if (++bufpos == bufsize)
+ bufpos = 0;
+
+ return buffer[bufpos];
+ }
+
+ if (++bufpos >= maxNextCharInd)
+ FillBuff();
+
+ char c = buffer[bufpos];
+
+ UpdateLineColumn(c);
+ return c;
+ }
+
+ @Deprecated
+ /**
+ * @deprecated
+ * @see #getEndColumn
+ */
+
+ public int getColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ @Deprecated
+ /**
+ * @deprecated
+ * @see #getEndLine
+ */
+
+ public int getLine() {
+ return bufline[bufpos];
+ }
+
+ /** Get token end column number. */
+ public int getEndColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ /** Get token end line number. */
+ public int getEndLine() {
+ return bufline[bufpos];
+ }
+
+ /** Get token beginning column number. */
+ public int getBeginColumn() {
+ return bufcolumn[tokenBegin];
+ }
+
+ /** Get token beginning line number. */
+ public int getBeginLine() {
+ return bufline[tokenBegin];
+ }
+
+/** Backup a number of characters. */
+ public void backup(int amount) {
+
+ inBuf += amount;
+ if ((bufpos -= amount) < 0)
+ bufpos += bufsize;
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn)
+ {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.Reader dstream)
+ {
+ this(dstream, 1, 1, 4096);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ if (buffer == null || buffersize != buffer.length)
+ {
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+ prevCharIsLF = prevCharIsCR = false;
+ tokenBegin = inBuf = maxNextCharInd = 0;
+ bufpos = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn)
+ {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader dstream)
+ {
+ ReInit(dstream, 1, 1, 4096);
+ }
+ /** Constructor. */
+ public SimpleCharStream(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 SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException
+ {
+ this(dstream, encoding, startline, startcolumn, 4096);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn)
+ {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+ {
+ this(dstream, encoding, 1, 1, 4096);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream)
+ {
+ this(dstream, 1, 1, 4096);
+ }
+
+ /** Reinitialise. */
+ 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,
+ int startcolumn, int buffersize)
+ {
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ /** Reinitialise. */
+ 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)
+ {
+ ReInit(dstream, 1, 1, 4096);
+ }
+ /** Reinitialise. */
+ 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,
+ int startcolumn)
+ {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+ /** Get token literal value. */
+ public String GetImage()
+ {
+ if (bufpos >= tokenBegin)
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
+ else
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +
+ new String(buffer, 0, bufpos + 1);
+ }
+
+ /** Get the suffix. */
+ public char[] GetSuffix(int len)
+ {
+ char[] ret = new char[len];
+
+ if ((bufpos + 1) >= len)
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
+ else
+ {
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+ len - bufpos - 1);
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+ }
+
+ return ret;
+ }
+
+ /** Reset buffer when finished. */
+ public void Done()
+ {
+ buffer = null;
+ bufline = null;
+ bufcolumn = null;
+ }
+
+ /**
+ * Method to adjust line and column numbers for the start of a token.
+ */
+ public void adjustBeginLineColumn(int newLine, int newCol)
+ {
+ int start = tokenBegin;
+ int len;
+
+ if (bufpos >= tokenBegin)
+ {
+ len = bufpos - tokenBegin + inBuf + 1;
+ }
+ else
+ {
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+ }
+
+ int i = 0, j = 0, k = 0;
+ int nextColDiff = 0, columnDiff = 0;
+
+ while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
+ {
+ bufline[j] = newLine;
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+ bufcolumn[j] = newCol + columnDiff;
+ columnDiff = nextColDiff;
+ i++;
+ }
+
+ if (i < len)
+ {
+ bufline[j] = newLine++;
+ bufcolumn[j] = newCol + columnDiff;
+
+ while (i++ < len)
+ {
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+ bufline[j] = newLine++;
+ else
+ bufline[j] = newLine;
+ }
+ }
+
+ line = bufline[j];
+ column = bufcolumn[j];
+ }
+
+}
+/* JavaCC - OriginalChecksum=94acc01d09adb6a7baa777758971c02c (do not edit this line) */
Added: incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/Token.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/Token.java?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/Token.java (added)
+++ incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/Token.java Fri Apr 1 12:47:48 2011
@@ -0,0 +1,131 @@
+/* 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 */
+package org.apache.stanbol.rules.manager.parse;
+
+/**
+ * Describes the input token stream.
+ */
+
+public class Token implements java.io.Serializable {
+
+ /**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * An integer that describes the kind of this token. This numbering
+ * system is determined by JavaCCParser, and a table of these numbers is
+ * stored in the file ...Constants.java.
+ */
+ public int kind;
+
+ /** The line number of the first character of this Token. */
+ public int beginLine;
+ /** The column number of the first character of this Token. */
+ public int beginColumn;
+ /** The line number of the last character of this Token. */
+ public int endLine;
+ /** The column number of the last character of this Token. */
+ public int endColumn;
+
+ /**
+ * The string image of the token.
+ */
+ public String image;
+
+ /**
+ * A reference to the next regular (non-special) token from the input
+ * stream. If this is the last token from the input stream, or if the
+ * token manager has not read tokens beyond this one, this field is
+ * set to null. This is true only if this token is also a regular
+ * token. Otherwise, see below for a description of the contents of
+ * this field.
+ */
+ public Token next;
+
+ /**
+ * This field is used to access special tokens that occur prior to this
+ * token, but after the immediately preceding regular (non-special) token.
+ * If there are no such special tokens, this field is set to null.
+ * When there are more than one such special token, this field refers
+ * to the last of these special tokens, which in turn refers to the next
+ * previous special token through its specialToken field, and so on
+ * until the first special token (whose specialToken field is null).
+ * The next fields of special tokens refer to other special tokens that
+ * immediately follow it (without an intervening regular token). If there
+ * is no such token, this field is null.
+ */
+ public Token specialToken;
+
+ /**
+ * An optional attribute value of the Token.
+ * Tokens which are not used as syntactic sugar will often contain
+ * meaningful values that will be used later on by the compiler or
+ * interpreter. This attribute value is often different from the image.
+ * Any subclass of Token that actually wants to return a non-null value can
+ * override this method as appropriate.
+ */
+ public Object getValue() {
+ return null;
+ }
+
+ /**
+ * No-argument constructor
+ */
+ public Token() {}
+
+ /**
+ * Constructs a new token for the specified Image.
+ */
+ public Token(int kind)
+ {
+ this(kind, null);
+ }
+
+ /**
+ * Constructs a new token for the specified Image and Kind.
+ */
+ public Token(int kind, String image)
+ {
+ this.kind = kind;
+ this.image = image;
+ }
+
+ /**
+ * Returns the image.
+ */
+ public String toString()
+ {
+ return image;
+ }
+
+ /**
+ * Returns a new Token object, by default. However, if you want, you
+ * can create and return subclass objects based on the value of ofKind.
+ * Simply add the cases to the switch for all those special cases.
+ * For example, if you have a subclass of Token called IDToken that
+ * you want to create if ofKind is ID, simply add something like :
+ *
+ * case MyParserConstants.ID : return new IDToken(ofKind, image);
+ *
+ * to the following switch statement. Then you can cast matchedToken
+ * variable to the appropriate type and use sit in your lexical actions.
+ */
+ public static Token newToken(int ofKind, String image)
+ {
+ switch(ofKind)
+ {
+ default : return new Token(ofKind, image);
+ }
+ }
+
+ public static Token newToken(int ofKind)
+ {
+ return newToken(ofKind, null);
+ }
+
+}
+/* JavaCC - OriginalChecksum=00bc249e3d0576986fbadc2dfe122766 (do not edit this line) */
Added: incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/TokenMgrError.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/TokenMgrError.java?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/TokenMgrError.java (added)
+++ incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/TokenMgrError.java Fri Apr 1 12:47:48 2011
@@ -0,0 +1,147 @@
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */
+/* JavaCCOptions: */
+package org.apache.stanbol.rules.manager.parse;
+
+/** Token Manager Error. */
+public class TokenMgrError extends Error
+{
+
+ /**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /*
+ * Ordinals for various reasons why an Error of this type can be thrown.
+ */
+
+ /**
+ * Lexical error occurred.
+ */
+ 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;
+
+ /**
+ * Tried to change to an invalid lexical state.
+ */
+ 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;
+
+ /**
+ * Indicates the reason why the exception is thrown. It will have
+ * one of the above 4 values.
+ */
+ int errorCode;
+
+ /**
+ * Replaces unprintable characters by their escaped (or unicode escaped)
+ * equivalents in the given string
+ */
+ protected static final String addEscapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
+ }
+ }
+ return retval.toString();
+ }
+
+ /**
+ * Returns a detailed message for the Error when it is thrown by the
+ * token manager to indicate a lexical error.
+ * Parameters :
+ * EOFSeen : indicates if EOF caused the lexical error
+ * curLexState : 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) + "\"");
+ }
+
+ /**
+ * You can also modify the body of this method to customize your error messages.
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+ * of end-users concern, so you can return something like :
+ *
+ * "Internal Error : Please file a bug report .... "
+ *
+ * from this method for such cases in the release version of your parser.
+ */
+ public String getMessage() {
+ return super.getMessage();
+ }
+
+ /*
+ * Constructors of various flavors follow.
+ */
+
+ /** No arg constructor. */
+ public TokenMgrError() {
+ }
+
+ /** Constructor with message and reason. */
+ public TokenMgrError(String message, int reason) {
+ super(message);
+ errorCode = reason;
+ }
+
+ /** 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);
+ }
+}
+/* JavaCC - OriginalChecksum=664c3849ea3eaefa65452ccdfcf1e179 (do not edit this line) */
Propchange: incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/util/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 1 12:47:48 2011
@@ -0,0 +1 @@
+target
Added: incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/util/RuleOntologyInputSource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/util/RuleOntologyInputSource.java?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/util/RuleOntologyInputSource.java (added)
+++ incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/util/RuleOntologyInputSource.java Fri Apr 1 12:47:48 2011
@@ -0,0 +1,74 @@
+package org.apache.stanbol.rules.manager.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.WeightedTcProvider;
+import org.apache.clerezza.rdf.core.serializedform.SerializingProvider;
+import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;
+import org.apache.clerezza.rdf.jena.serializer.JenaSerializerProvider;
+import org.apache.stanbol.ontologymanager.ontonet.api.io.OntologyInputSource;
+import org.semanticweb.owlapi.apibinding.OWLManager;
+import org.semanticweb.owlapi.model.IRI;
+import org.semanticweb.owlapi.model.OWLOntology;
+import org.semanticweb.owlapi.model.OWLOntologyCreationException;
+import org.semanticweb.owlapi.model.OWLOntologyManager;
+
+public class RuleOntologyInputSource implements OntologyInputSource {
+
+ private OWLOntology rootOntology;
+ private IRI physicalIri;
+ private WeightedTcProvider weightedTcProvider;
+
+ public RuleOntologyInputSource(OWLOntology rootOntology, WeightedTcProvider weightedTcProvider) {
+ this.rootOntology = rootOntology;
+ this.weightedTcProvider = weightedTcProvider;
+ try {
+ physicalIri = rootOntology.getOntologyID().getDefaultDocumentIRI();
+ } catch (Exception e) {
+ // Ontology might be anonymous, no physical IRI then...
+ }
+
+ }
+
+ @Override
+ public IRI getPhysicalIRI() {
+ return physicalIri;
+ }
+
+ @Override
+ public OWLOntology getRootOntology() {
+ OWLOntology ontology = null;
+
+ OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
+
+ try {
+
+ MGraph mGraph = weightedTcProvider.getMGraph(new UriRef(physicalIri.toString()));
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+ SerializingProvider serializingProvider = new JenaSerializerProvider();
+
+ serializingProvider.serialize(out, mGraph, SupportedFormat.RDF_XML);
+
+ ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
+ ontology = manager.loadOntologyFromOntologyDocument(in);
+ } catch (OWLOntologyCreationException e) {
+ e.printStackTrace();
+ }
+ return ontology;
+ }
+
+ @Override
+ public boolean hasPhysicalIRI() {
+ return physicalIri != null;
+ }
+
+ @Override
+ public boolean hasRootOntology() {
+ return rootOntology != null;
+ }
+
+}
Propchange: incubator/stanbol/trunk/rules/manager/src/main/resources/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 1 12:47:48 2011
@@ -0,0 +1 @@
+target
Propchange: incubator/stanbol/trunk/rules/manager/src/main/resources/META-INF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 1 12:47:48 2011
@@ -0,0 +1 @@
+target
Propchange: incubator/stanbol/trunk/rules/manager/src/main/resources/META-INF/conf/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 1 12:47:48 2011
@@ -0,0 +1 @@
+target
Added: incubator/stanbol/trunk/rules/manager/src/main/resources/META-INF/conf/rmi_config.owl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/manager/src/main/resources/META-INF/conf/rmi_config.owl?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/manager/src/main/resources/META-INF/conf/rmi_config.owl (added)
+++ incubator/stanbol/trunk/rules/manager/src/main/resources/META-INF/conf/rmi_config.owl Fri Apr 1 12:47:48 2011
@@ -0,0 +1,186 @@
+<?xml version="1.0"?>
+
+
+<!DOCTYPE rdf:RDF [
+ <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+ <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+ <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+ <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+ <!ENTITY rmi "http://kres.iks-project.eu/ontology/meta/rmi.owl#" >
+ <!ENTITY sequence "http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#" >
+]>
+
+
+<rdf:RDF xmlns="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#"
+ xml:base="http://kres.iks-project.eu/ontology/meta/rmi_config.owl"
+ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+ xmlns:sequence="http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#"
+ xmlns:owl="http://www.w3.org/2002/07/owl#"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:rmi="http://kres.iks-project.eu/ontology/meta/rmi.owl#">
+ <owl:Ontology rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl">
+ <owl:imports rdf:resource="http://ontologydesignpatterns.org/ont/iks/kres/rmi.owl"/>
+ </owl:Ontology>
+
+
+
+ <!--
+ ///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Object Properties
+ //
+ ///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#endWith -->
+
+ <owl:ObjectProperty rdf:about="&rmi;endWith"/>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasRule -->
+
+ <owl:ObjectProperty rdf:about="&rmi;hasRule"/>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#startWith -->
+
+ <owl:ObjectProperty rdf:about="&rmi;startWith"/>
+
+
+
+ <!-- http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#directlyPrecedes -->
+
+ <owl:ObjectProperty rdf:about="&sequence;directlyPrecedes"/>
+
+
+
+ <!--
+ ///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Data properties
+ //
+ ///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasBodyAndHead -->
+
+ <owl:DatatypeProperty rdf:about="&rmi;hasBodyAndHead"/>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasDescription -->
+
+ <owl:DatatypeProperty rdf:about="&rmi;hasDescription"/>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasSequence -->
+
+ <owl:DatatypeProperty rdf:about="&rmi;hasSequence"/>
+
+
+
+ <!--
+ ///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Classes
+ //
+ ///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#KReSRule -->
+
+ <owl:Class rdf:about="&rmi;KReSRule"/>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#Recipe -->
+
+ <owl:Class rdf:about="&rmi;Recipe"/>
+
+
+
+ <!--
+ ///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Individuals
+ //
+ ///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRecipeA -->
+
+ <owl:NamedIndividual rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRecipeA">
+ <rdf:type rdf:resource="&rmi;Recipe"/>
+ <rmi:hasDescription rdf:datatype="&xsd;string">Some description here</rmi:hasDescription>
+ <rmi:hasSequence rdf:datatype="&xsd;string">http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB,http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA</rmi:hasSequence>
+ <rmi:hasRule rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA"/>
+ <rmi:endWith rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA"/>
+ <rmi:hasRule rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB"/>
+ <rmi:startWith rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB"/>
+ </owl:NamedIndividual>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA -->
+
+ <owl:NamedIndividual rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA">
+ <rdf:type rdf:resource="&rmi;KReSRule"/>
+ <rmi:hasDescription rdf:datatype="&xsd;string">An example of description for my rule A</rmi:hasDescription>
+ <rmi:hasBodyAndHead rdf:datatype="&xsd;string">BodyA -> BodyB</rmi:hasBodyAndHead>
+ </owl:NamedIndividual>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB -->
+
+ <owl:NamedIndividual rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB">
+ <rdf:type rdf:resource="&rmi;KReSRule"/>
+ <rmi:hasDescription rdf:datatype="&xsd;string">An example of description..for my rule B</rmi:hasDescription>
+ <rmi:hasBodyAndHead rdf:datatype="&xsd;string">BodyB -> HeadB</rmi:hasBodyAndHead>
+ <sequence:directlyPrecedes rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA"/>
+ </owl:NamedIndividual>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRecipe -->
+
+ <owl:NamedIndividual rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRecipe">
+ <rdf:type rdf:resource="&rmi;Recipe"/>
+ <rmi:hasDescription rdf:datatype="&xsd;string">A single rule recipe.</rmi:hasDescription>
+ <rmi:hasSequence rdf:datatype="&xsd;string">http://kres.iks-project.eu/ontology/meta/rmi.owl#ProvaParentRule</rmi:hasSequence>
+ <rmi:endWith rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule"/>
+ <rmi:hasRule rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule"/>
+ <rmi:startWith rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule"/>
+ </owl:NamedIndividual>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule -->
+
+ <owl:NamedIndividual rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule">
+ <rdf:type rdf:resource="&rmi;KReSRule"/>
+ <rmi:hasDescription rdf:datatype="&xsd;string">A rule to inference if a person has an uncle.</rmi:hasDescription>
+ <rmi:hasBodyAndHead rdf:datatype="&xsd;string">ProvaParent = <http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#> . rule1[ has(ProvaParent:hasParent, ?x, ?y) . has(ProvaParent:hasBrother, ?y, ?z) -> has(ProvaParent:hasUncle, ?x, ?z) ]</rmi:hasBodyAndHead>
+ </owl:NamedIndividual>
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.0.0.1451) http://owlapi.sourceforge.net -->
+
Added: incubator/stanbol/trunk/rules/manager/src/main/resources/RuleFileExample.txt
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/manager/src/main/resources/RuleFileExample.txt?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/manager/src/main/resources/RuleFileExample.txt (added)
+++ incubator/stanbol/trunk/rules/manager/src/main/resources/RuleFileExample.txt Fri Apr 1 12:47:48 2011
@@ -0,0 +1,60 @@
+#This is a comment to the file
+
+#These are the rules that I want to insert in the system.
+$KReSRule
+@MyRuleA
+*My comment to the rule A
+MyRuleABody -> MyRuleAHead
+@MyRuleB
+*My comment to the rule B
+MyRuleBBody -> MyRuleBHead
+@MyRuleC
+*My comment to the rule C
+MyRuleCBody -> MyRuleCHead
+
+#This is a recipe
+
+$Recipe
+@MyRecipe
+*My comment to the recipe
+MyRuleC
+MyRuleB
+MyRuleA
+
+#These are the rules that I want to insert in the system.
+$KReSRule
+@MyRuleD
+*My comment to the rule D
+MyRuleDBody -> MyRuleDHead
+@MyRuleE
+*My comment to the rule E
+MyRuleEBody -> MyRuleEHead
+@MyRuleF
+*My comment to the rule F
+MyRuleFBody -> MyRuleFHead
+
+#This is a recipe
+
+$Recipe
+@MyRecipe2
+*My comment to the recipe 2
+MyRuleE
+MyRuleD
+
+$Recipe
+@MyRecipe3
+*My comment to the recipe 3
+MyRuleF
+
+$Recipe
+@MyRecipe4
+*My comment to the recipe 4
+MyRuleC
+MyRuleF
+MyRuleB
+MyRuleD
+
+$KReSRule
+@MyRuleX
+*My comment to the rule X
+PREFIX var http://kres.iksproject.eu/rules# .PREFIX dbs http://andriry.altervista.org/tesiSpecialistica/dbs_l1.owl# .PREFIX lmm http://www.ontologydesignpatterns.org/ont/lmm/LMM_L1.owl# .rule1[dbs:Table(?x) -> lmm:Meaning(?x)]
Propchange: incubator/stanbol/trunk/rules/manager/src/main/resources/RuleOntology/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 1 12:47:48 2011
@@ -0,0 +1 @@
+target
Added: incubator/stanbol/trunk/rules/manager/src/main/resources/RuleOntology/OffLineKReSOntologyRules.owl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/manager/src/main/resources/RuleOntology/OffLineKReSOntologyRules.owl?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/manager/src/main/resources/RuleOntology/OffLineKReSOntologyRules.owl (added)
+++ incubator/stanbol/trunk/rules/manager/src/main/resources/RuleOntology/OffLineKReSOntologyRules.owl Fri Apr 1 12:47:48 2011
@@ -0,0 +1,317 @@
+<?xml version="1.0"?>
+
+
+<!DOCTYPE rdf:RDF [
+ <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+ <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+ <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+ <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+ <!ENTITY rmi "http://kres.iks-project.eu/ontology/meta/rmi.owl#" >
+ <!ENTITY sequence "http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#" >
+ <!ENTITY cpannotationschema "http://www.ontologydesignpatterns.org/schemas/cpannotationschema.owl#" >
+]>
+
+
+<rdf:RDF xmlns="http://eu.iksproject.kres/KReSOntologyRules.owl#"
+ xml:base="http://eu.iksproject.kres/KReSOntologyRules.owl"
+ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+ xmlns:cpannotationschema="http://www.ontologydesignpatterns.org/schemas/cpannotationschema.owl#"
+ xmlns:sequence="http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#"
+ xmlns:owl="http://www.w3.org/2002/07/owl#"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:rmi="http://kres.iks-project.eu/ontology/meta/rmi.owl#">
+ <owl:Ontology rdf:about="http://kres.iks-project.eu/ontology/meta/rmi.owl"/>
+
+
+
+ <!--
+ ///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Annotation properties
+ //
+ ///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+ <owl:AnnotationProperty rdf:about="&cpannotationschema;hasAuthor"/>
+ <owl:AnnotationProperty rdf:about="&cpannotationschema;hasConsequences"/>
+ <owl:AnnotationProperty rdf:about="&cpannotationschema;extractedFrom"/>
+ <owl:AnnotationProperty rdf:about="&cpannotationschema;coversRequirements"/>
+ <owl:AnnotationProperty rdf:about="&cpannotationschema;hasIntent"/>
+ <owl:AnnotationProperty rdf:about="&rdfs;label"/>
+ <owl:AnnotationProperty rdf:about="&rdfs;comment"/>
+
+
+
+ <!--
+ ///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Object Properties
+ //
+ ///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#endWith -->
+
+ <owl:ObjectProperty rdf:about="&rmi;endWith">
+ <rdfs:range rdf:resource="&rmi;KReSRule"/>
+ <rdfs:domain rdf:resource="&rmi;Recipe"/>
+ <rdfs:subPropertyOf rdf:resource="&owl;topObjectProperty"/>
+ </owl:ObjectProperty>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasRule -->
+
+ <owl:ObjectProperty rdf:about="&rmi;hasRule">
+ <rdfs:range rdf:resource="&rmi;KReSRule"/>
+ <rdfs:domain rdf:resource="&rmi;Recipe"/>
+ <owl:inverseOf rdf:resource="&rmi;isRuleOf"/>
+ <rdfs:subPropertyOf rdf:resource="&owl;topObjectProperty"/>
+ </owl:ObjectProperty>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#isRuleOf -->
+
+ <owl:ObjectProperty rdf:about="&rmi;isRuleOf">
+ <rdfs:domain rdf:resource="&rmi;KReSRule"/>
+ <rdfs:range rdf:resource="&rmi;Recipe"/>
+ <rdfs:subPropertyOf rdf:resource="&owl;topObjectProperty"/>
+ </owl:ObjectProperty>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#startWith -->
+
+ <owl:ObjectProperty rdf:about="&rmi;startWith">
+ <rdfs:range rdf:resource="&rmi;KReSRule"/>
+ <rdfs:domain rdf:resource="&rmi;Recipe"/>
+ <rdfs:subPropertyOf rdf:resource="&owl;topObjectProperty"/>
+ </owl:ObjectProperty>
+
+
+
+ <!-- http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#directlyFollows -->
+
+ <owl:ObjectProperty rdf:about="&sequence;directlyFollows">
+ <rdfs:label xml:lang="en">directly follows</rdfs:label>
+ <rdfs:label xml:lang="it">segue direttamente</rdfs:label>
+ <rdfs:comment>The intransitive follows relation. For example, Wednesday directly precedes Thursday. Directness of precedence depends on the designer conceptualization.</rdfs:comment>
+ <owl:inverseOf rdf:resource="&sequence;directlyPrecedes"/>
+ <rdfs:subPropertyOf rdf:resource="&sequence;follows"/>
+ <rdfs:range rdf:resource="&owl;Thing"/>
+ <rdfs:domain rdf:resource="&owl;Thing"/>
+ </owl:ObjectProperty>
+
+
+
+ <!-- http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#directlyPrecedes -->
+
+ <owl:ObjectProperty rdf:about="&sequence;directlyPrecedes">
+ <rdfs:label xml:lang="en">directly precedes</rdfs:label>
+ <rdfs:label xml:lang="it">precede direttamente</rdfs:label>
+ <rdfs:comment>The intransitive precedes relation. For example, Monday directly precedes Tuesday. Directness of precedence depends on the designer conceptualization.</rdfs:comment>
+ <rdfs:subPropertyOf rdf:resource="&sequence;precedes"/>
+ <rdfs:range rdf:resource="&owl;Thing"/>
+ <rdfs:domain rdf:resource="&owl;Thing"/>
+ </owl:ObjectProperty>
+
+
+
+ <!-- http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#follows -->
+
+ <owl:ObjectProperty rdf:about="&sequence;follows">
+ <rdf:type rdf:resource="&owl;TransitiveProperty"/>
+ <rdfs:label xml:lang="en">follows</rdfs:label>
+ <rdfs:label xml:lang="it">segue</rdfs:label>
+ <rdfs:comment rdf:datatype="&xsd;string">A relation between entities, expressing a 'sequence' schema.
+E.g. 'year 2000 follows 1999', 'preparing coffee' follows 'deciding what coffee to use', 'II World War follows I World War', etc.
+It can be used between tasks, processes or time intervals, and subproperties would fit best in order to distinguish the different uses.</rdfs:comment>
+ <rdfs:domain rdf:resource="&owl;Thing"/>
+ <rdfs:range rdf:resource="&owl;Thing"/>
+ </owl:ObjectProperty>
+
+
+
+ <!-- http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#precedes -->
+
+ <owl:ObjectProperty rdf:about="&sequence;precedes">
+ <rdf:type rdf:resource="&owl;TransitiveProperty"/>
+ <rdfs:label xml:lang="en">precedes</rdfs:label>
+ <rdfs:label xml:lang="it">precede</rdfs:label>
+ <rdfs:comment rdf:datatype="&xsd;string">A relation between entities, expressing a 'sequence' schema.
+E.g. 'year 1999 precedes 2000', 'deciding what coffee to use' precedes 'preparing coffee', 'World War II follows World War I', 'in the Milan to Rome autoroute, Bologna precedes Florence', etc.
+It can then be used between tasks, processes, time intervals, spatially locate objects, situations, etc.
+Subproperties can be defined in order to distinguish the different uses.</rdfs:comment>
+ <owl:inverseOf rdf:resource="&sequence;follows"/>
+ <rdfs:domain rdf:resource="&owl;Thing"/>
+ <rdfs:range rdf:resource="&owl;Thing"/>
+ </owl:ObjectProperty>
+
+
+
+ <!-- http://www.w3.org/2002/07/owl#topObjectProperty -->
+
+ <owl:ObjectProperty rdf:about="&owl;topObjectProperty"/>
+
+
+
+ <!--
+ ///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Data properties
+ //
+ ///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasBodyAndHead -->
+
+ <owl:DatatypeProperty rdf:about="&rmi;hasBodyAndHead">
+ <rdfs:domain rdf:resource="&rmi;KReSRule"/>
+ <rdfs:subPropertyOf rdf:resource="&rmi;topDataProperty"/>
+ <rdfs:range rdf:resource="&xsd;string"/>
+ </owl:DatatypeProperty>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasDescription -->
+
+ <owl:DatatypeProperty rdf:about="&rmi;hasDescription">
+ <rdfs:subPropertyOf rdf:resource="&rmi;topDataProperty"/>
+ <rdfs:range rdf:resource="&xsd;string"/>
+ <rdfs:domain rdf:resource="&owl;Thing"/>
+ </owl:DatatypeProperty>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasSequence -->
+
+ <owl:DatatypeProperty rdf:about="&rmi;hasSequence">
+ <rdfs:domain rdf:resource="&rmi;Recipe"/>
+ <rdfs:subPropertyOf rdf:resource="&rmi;topDataProperty"/>
+ <rdfs:range rdf:resource="&xsd;string"/>
+ </owl:DatatypeProperty>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#topDataProperty -->
+
+ <owl:DatatypeProperty rdf:about="&rmi;topDataProperty"/>
+
+
+
+ <!--
+ ///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Classes
+ //
+ ///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#KReSRule -->
+
+ <owl:Class rdf:about="&rmi;KReSRule">
+ <rdfs:subClassOf rdf:resource="&owl;Thing"/>
+ <rdfs:subClassOf>
+ <owl:Restriction>
+ <owl:onProperty rdf:resource="&rmi;isRuleOf"/>
+ <owl:someValuesFrom rdf:resource="&rmi;Recipe"/>
+ </owl:Restriction>
+ </rdfs:subClassOf>
+ <owl:disjointWith rdf:resource="&rmi;Recipe"/>
+ </owl:Class>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#Recipe -->
+
+ <owl:Class rdf:about="&rmi;Recipe">
+ <rdfs:subClassOf rdf:resource="&owl;Thing"/>
+ <rdfs:subClassOf>
+ <owl:Restriction>
+ <owl:onProperty rdf:resource="&rmi;hasRule"/>
+ <owl:onClass rdf:resource="&rmi;KReSRule"/>
+ <owl:minQualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minQualifiedCardinality>
+ </owl:Restriction>
+ </rdfs:subClassOf>
+ </owl:Class>
+
+
+
+ <!-- http://www.w3.org/2002/07/owl#Thing -->
+
+ <owl:Class rdf:about="&owl;Thing"/>
+
+
+
+ <!--
+ ///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Annotations
+ //
+ ///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+ <rdf:Description rdf:about="http://eu.iksproject.kres/KReSOntologyRules.owl#isRuleOf">
+ <rdfs:label xml:lang="en">is rule of</rdfs:label>
+ <rdfs:label xml:lang="it">è regola di</rdfs:label>
+ <rdfs:comment xml:lang="en">This property links a KReS rule to a Recipe</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description rdf:about="http://eu.iksproject.kres/KReSOntologyRules.owl#hasDescription">
+ <rdfs:label xml:lang="en">has description</rdfs:label>
+ <rdfs:label xml:lang="it">ha descrizione</rdfs:label>
+ <rdfs:comment xml:lang="en">Any kind of description about rules or recipes.</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description rdf:about="http://eu.iksproject.kres/KReSOntologyRules.owl#startWith">
+ <rdfs:label xml:lang="en">start with</rdfs:label>
+ <rdfs:label xml:lang="it">inizia con</rdfs:label>
+ <rdfs:comment xml:lang="en">This property identifies the starting rule of the recipe.</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description rdf:about="http://eu.iksproject.kres/KReSOntologyRules.owl#endWith">
+ <rdfs:label xml:lang="en">end with</rdfs:label>
+ <rdfs:label xml:lang="it">finisce con</rdfs:label>
+ <rdfs:comment xml:lang="en">This property identifies the last rule of the recipe.</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description rdf:about="http://eu.iksproject.kres/KReSOntologyRules.owl#hasBodyAndHead">
+ <rdfs:label xml:lang="en">has body and head</rdfs:label>
+ <rdfs:label xml:lang="it">ha corpo e testa</rdfs:label>
+ <rdfs:comment xml:lang="en">Physical Storage of a rule. Here there is the kres rule string.</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description rdf:about="http://eu.iksproject.kres/KReSOntologyRules.owl#KReSRule">
+ <rdfs:label xml:lang="en">SWRL rules</rdfs:label>
+ <rdfs:label xml:lang="it">Regole SWRL</rdfs:label>
+ <rdfs:comment xml:lang="en">This class contains the IRI (the name) that identifies the rule.</rdfs:comment>
+ <rdfs:comment xml:lang="it">Questa classe contiene gli IRI che identificano le regole (i nomi) su una o più ontologie. </rdfs:comment>
+ </rdf:Description>
+ <rdf:Description rdf:about="http://eu.iksproject.kres/KReSOntologyRules.owl#Recipe">
+ <rdfs:label xml:lang="en">Receipt</rdfs:label>
+ <rdfs:label xml:lang="it">Ricetta</rdfs:label>
+ <rdfs:comment xml:lang="en">"This class contains the IRI that identifies a sequence of rules to perform particular action on the dataset. It must have at least one KReS rule</rdfs:comment>
+ <rdfs:comment xml:lang="it">"Questa classe contiene l'IRI che identifica una sequenza di regole che eseguiranno una particolare azione sul dataset. L'istanza di questa classe deve contenere almeno una regola KReS</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description rdf:about="http://eu.iksproject.kres/KReSOntologyRules.owl#hasRule">
+ <rdfs:label xml:lang="en">has rule</rdfs:label>
+ <rdfs:label xml:lang="it">ha regola</rdfs:label>
+ <rdfs:comment xml:lang="en">This property links a Recipe instance to a KReS rule.</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description rdf:about="http://eu.iksproject.kres/KReSOntologyRules.owl#hasSequence">
+ <rdfs:label xml:lang="en">has sequence</rdfs:label>
+ <rdfs:label xml:lang="it">ha sequenza</rdfs:label>
+ <rdfs:comment xml:lang="en">Define the rule sequence of a recipe.</rdfs:comment>
+ </rdf:Description>
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.0.0.1451) http://owlapi.sourceforge.net -->
+