Magentix2  2.1.1
es.upv.dsic.gti_ia.norms.NormParser Class Reference
Inheritance diagram for es.upv.dsic.gti_ia.norms.NormParser:
Collaboration diagram for es.upv.dsic.gti_ia.norms.NormParser:

List of all members.

Classes

class  JJCalls
class  LookaheadSuccess

Public Member Functions

Norm parser () throws THOMASException, Exception, Error
final Norm norm () throws ParseException, InvalidIDException, Exception
final String id () throws ParseException, THOMASException
final String deontic () throws ParseException, THOMASException
final ArrayList< String > target () throws ParseException, THOMASException
final String activation () throws ParseException, THOMASException
final String expiration () throws ParseException, THOMASException
final String value () throws ParseException
final String genAtomicCondition () throws ParseException, THOMASException
final String genAtomicFormula () throws ParseException
final ArrayList< String > action () throws ParseException, THOMASException
final String atom () throws ParseException
final String listOfTerms () throws ParseException
final String term () throws ParseException
final String expression () throws ParseException, THOMASException
final String expressionRest () throws ParseException, THOMASException
final String simpleExpression () throws ParseException, THOMASException
final String relExpression () throws ParseException, THOMASException
final String relTerm () throws ParseException, THOMASException
final String arithExpression () throws ParseException
final String arithTerm () throws ParseException
final String variable () throws ParseException
final String constant () throws ParseException
final String numericConstant () throws ParseException
final String stringConstant () throws ParseException
final String OMSCondition () throws ParseException, THOMASException
final String OMSUnitPred () throws ParseException
final String OMSUnitTypesPred () throws ParseException
final String OMSRolesPred () throws ParseException
final String OMSAccessibilityPred () throws ParseException
final String OMSPositionsPred () throws ParseException
final String OMSVisibilityPred () throws ParseException
final String OMSNormsPred () throws ParseException
final String deonticPred () throws ParseException
final String targetTypePred () throws ParseException
final String targetValuePred () throws ParseException
final String OMSActionNamePred () throws ParseException
final String OMSActionName () throws ParseException
final String OMSRoleEnactPred () throws ParseException
final String numericConstantPred () throws ParseException
final ArrayList< String > OMSAction () throws ParseException, THOMASException
final String OMSConstants () throws ParseException
final String OMSPositions () throws ParseException
final String OMSaccessibility () throws ParseException
final String OMSVisibility () throws ParseException
final String OMSUnitTypes () throws ParseException
 NormParser (java.io.InputStream stream)
 NormParser (java.io.InputStream stream, String encoding)
void ReInit (java.io.InputStream stream)
void ReInit (java.io.InputStream stream, String encoding)
 NormParser (java.io.Reader stream)
void ReInit (java.io.Reader stream)
 NormParser (NormParserTokenManager tm)
void ReInit (NormParserTokenManager tm)
final Token getNextToken ()
final Token getToken (int index)
ParseException generateParseException ()
final void enable_tracing ()
final void disable_tracing ()

Public Attributes

NormParserTokenManager token_source
Token token
Token jj_nt

Static Package Functions

 [static initializer]

Package Attributes

SimpleCharStream jj_input_stream
Token jj_lastpos

Detailed Description

Definition at line 18 of file NormParser.java.


Constructor & Destructor Documentation

es.upv.dsic.gti_ia.norms.NormParser.NormParser ( java.io.InputStream  stream)

Constructor with InputStream.

Definition at line 3220 of file NormParser.java.

                                                 {
     ReInit(stream, null);
es.upv.dsic.gti_ia.norms.NormParser.NormParser ( java.io.InputStream  stream,
String  encoding 
)

Constructor with InputStream and supplied encoding

Definition at line 3224 of file NormParser.java.

                                                                  {
    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 < 38; i++) jj_la1[i] = -1;
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();

Constructor.

Definition at line 3250 of file NormParser.java.

                                               {

Constructor with generated Token Manager.

Definition at line 3272 of file NormParser.java.

                                                                 {
    Token oldToken;
    if ((oldToken = token).next != null) token = token.next;

Member Function Documentation

es.upv.dsic.gti_ia.norms.NormParser.[static initializer] ( ) [static, package]

action := OMSAction |genActionFormula

Definition at line 443 of file NormParser.java.

          {if (true) return result;}
    } catch (ParseException pex) {
                StringBuffer expected = new StringBuffer();
                for (int i = 0; i < pex.expectedTokenSequences.length; i++) {
                for (int j = 0; j < pex.expectedTokenSequences[i].length; j++) {
                        expected.append(tokenImage[pex.expectedTokenSequences[i][j]]).append(' ');
                }
        }

                String message = l10n.getMessage(MessageID.INVALID_OMS_ACTION,  pex.currentToken.next.beginColumn, getNextToken(), expected.toString());
                {if (true) throw new InvalidOMSActionException(message);}
    }
    throw new Error("Missing return statement in function");
  }

  final public String atom() throws ParseException {

activation ::= expression | "_"

Definition at line 221 of file NormParser.java.

                   {
      jj_consume_token(71);
               {if (true) return "";}
    } else {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case NOT:
      case SUBTRACTION:
      case OMSPositions:
      case OMSaccessibility:
      case OMSVisibility:
      case OMSUnitTypes:
      case isUnit:
      case hasType:
      case hasParent:
      case isRole:
      case hasAccessibility:
      case hasVisibility:
      case hasPosition:
      case isNorm:
      case hasDeontic:
      case hasTarget:
      case hasAction:
      case isAgent:
      case playsRole:
      case roleCardinality:
      case positionCardinality:
      case numericConstant:
      case variable:
      case stringConstant:
      case 71:
      case 72:
        expression = expression();
                             {if (true) return expression;}
        break;
      default:
        jj_la1[3] = jj_gen;

             {if (true) return "";}
      }
    }
    throw new Error("Missing return statement in function");
  }

arithExpression := arithTerm [ ( “+” |“-” |“*” |“**” |“/” |“div” |“mod” ) artihTerm]*

Definition at line 719 of file NormParser.java.

           :
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case SUM:
      case SUBTRACTION:
      case MULTIPLICATION:
      case POWER:
      case DIVISION:
      case INTDIVISION:
      case MODULE:
        ;
        break;
      default:
        jj_la1[16] = jj_gen;
        break label_3;
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case SUM:
        jj_consume_token(SUM);
                                         operator = token.image;
        break;
      case SUBTRACTION:
        jj_consume_token(SUBTRACTION);
                                                                                  operator = token.image;
        break;
      case MULTIPLICATION:
        jj_consume_token(MULTIPLICATION);
                                                                                                                              operator = token.image;
        break;
      case POWER:
        jj_consume_token(POWER);
                                                                                                                                                                   operator = token.image;
        break;
      case DIVISION:
        jj_consume_token(DIVISION);
                                                                                                                                                                                                         operator = token.image;
        break;
      case INTDIVISION:
        jj_consume_token(INTDIVISION);
                                                                                                                                                                                                                                                  operator = token.image;
        break;
      case MODULE:
        jj_consume_token(MODULE);
                                                                                                                                                                                                                                                                                      operator = token.image;
        break;
      default:
        jj_la1[17] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      arithTerm2 = arithTerm();
    }
         {if (true) return arithTerm + operator + arithTerm2;}
    throw new Error("Missing return statement in function");
  }

  final public String arithTerm() throws ParseException {

arithTerm := numericConstant |variable |“-” arithTerm |“(” arithExpression “)”

Definition at line 783 of file NormParser.java.

          {if (true) return result;}
      break;
    case variable:
    case 71:
      result = variable();
          {if (true) return result;}
      break;
    case SUBTRACTION:
      jj_consume_token(SUBTRACTION);
                           result = token.image;
      arithTerm = arithTerm();
          {if (true) return result + arithTerm;}
      break;
    case 72:
      jj_consume_token(72);
      arithExpression = arithExpression();
      jj_consume_token(73);
          {if (true) return "("+arithExpression+")";}
      break;
    default:
      jj_la1[18] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String variable() throws ParseException {

atom ::= OMSConstants | stringConstant

Definition at line 466 of file NormParser.java.

                      :
    case OMSUnitTypes:
      result = OMSConstants();
                  {if (true) return result;}
      break;
    case stringConstant:
      result = stringConstant();
                 {if (true) return result;}
      break;
    default:
      jj_la1[9] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String listOfTerms() throws ParseException {

constant := numericConstant |stringConstant

Definition at line 840 of file NormParser.java.

          {if (true) return result;}
      break;
    case numericConstant:
      result = numericConstant();
          {if (true) return result;}
      break;
    default:
      jj_la1[20] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String numericConstant() throws ParseException {

deontinc ::= "o"|"f"|"p"

Definition at line 91 of file NormParser.java.

                                                                       {
    try {
      jj_consume_token(deontic);
                            {if (true) return token.image;}
    } catch (ParseException e) {
                String message = l10n.getMessage(MessageID.INVALID_DEONTIC, e.currentToken.next.beginLine, e.currentToken.next.beginColumn, getNextToken());
                {if (true) throw new InvalidDeonticException(message);}
    }
    throw new Error("Missing return statement in function");
  }

deonticContent := deontic | "_"

Definition at line 1192 of file NormParser.java.

                                                             {
  String result = "";
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case roleName:
      jj_consume_token(roleName);
         {if (true) return token.image;}
      break;
    case agentName:
      jj_consume_token(agentName);
         {if (true) return token.image;}

Disable tracing.

Definition at line 3441 of file NormParser.java.

                  : jj_3_3(); break;
            case 3: jj_3_4(); break;

Enable tracing.

Definition at line 3437 of file NormParser.java.

                     {

expiration := expression |“_”

Definition at line 269 of file NormParser.java.

                   {
      jj_consume_token(71);
       {if (true) return "";}
    } else {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case NOT:
      case SUBTRACTION:
      case OMSPositions:
      case OMSaccessibility:
      case OMSVisibility:
      case OMSUnitTypes:
      case isUnit:
      case hasType:
      case hasParent:
      case isRole:
      case hasAccessibility:
      case hasVisibility:
      case hasPosition:
      case isNorm:
      case hasDeontic:
      case hasTarget:
      case hasAction:
      case isAgent:
      case playsRole:
      case roleCardinality:
      case positionCardinality:
      case numericConstant:
      case variable:
      case stringConstant:
      case 71:
      case 72:
        result = expression();
                              {if (true) return result;}
        break;
      default:
        jj_la1[4] = jj_gen;

      {if (true) return "";}
      }
    }
    throw new Error("Missing return statement in function");
  }

expression := simpleExpression |“not” expression |expression “&” expression |expression “||”’ expression |“(” expression “)”

Definition at line 552 of file NormParser.java.

        {
      if (jj_2_5(2)) {
        simpleExpression = simpleExpression();
        expressionRest = expressionRest();
         {if (true) return simpleExpression + " " + expressionRest;}
      } else {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case NOT:
          jj_consume_token(NOT);
          expression = expression();
          expressionRest = expressionRest();
         {if (true) return operator +" " + expression + " " + expressionRest;}
          break;
        case 72:
          jj_consume_token(72);
          expression = expression();
          jj_consume_token(73);
          expressionRest = expressionRest();
         {if (true) return "(" + expression + ")" + " " + expressionRest;}
          break;
        default:
          jj_la1[12] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    } catch (ParseException pex) {
        String message = l10n.getMessage(MessageID.INVALID_EXPRESSION,  pex.currentToken.next.beginColumn, getNextToken());
                {if (true) throw new InvalidExpressionException(message);}
    }
    throw new Error("Missing return statement in function");
  }

  final public String expressionRest() throws ParseException, THOMASException {

expressionRest ::= "and" expression() | "or" expression() | vacio

Definition at line 594 of file NormParser.java.

              :
        jj_consume_token(AND);
                 operator = token.image;
        result = expression();
             {if (true) return  operator + " "+  result;}
        break;
      case OR:
        jj_consume_token(OR);
                 operator = token.image;
        result = expression();
             {if (true) return  operator + " " + result;}
        break;
      default:
        jj_la1[13] = jj_gen;

         {if (true) return "";}
      }
    } catch (ParseException pex) {
        String message = l10n.getMessage(MessageID.INVALID_EXPRESSION,  pex.currentToken.next.beginColumn, getNextToken());
                {if (true) throw new InvalidExpressionException(message);}
    }
    throw new Error("Missing return statement in function");
  }

  final public String simpleExpression() throws ParseException, THOMASException {

genAtomicCondition ::= OMSCondition |genAtomicFormula

Definition at line 352 of file NormParser.java.

                  :
    case isRole:
    case hasAccessibility:
    case hasVisibility:
    case hasPosition:
    case isNorm:
    case hasDeontic:
    case hasTarget:
    case hasAction:
    case isAgent:
    case playsRole:
    case roleCardinality:
    case positionCardinality:
      result = OMSCondition();
         {if (true) return result;}
      break;
    case OMSPositions:
    case OMSaccessibility:
    case OMSVisibility:
    case OMSUnitTypes:
    case variable:
    case stringConstant:
    case 71:
      result = genAtomicFormula();
         {if (true) return result;}
      break;
    default:
      jj_la1[6] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String genAtomicFormula() throws ParseException {

genAtomicFormula ::= stringConstant [ “(” listOfTerms “)”] |variable |OMSConstants

Definition at line 394 of file NormParser.java.

                                 :jj_ntk) {
    case stringConstant:
      //(atom()| variable())["(" listOfTerms() ")"]
      
              stringConstantResult = stringConstant();
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case 72:
        jj_consume_token(72);
                                                    op1 = token.image;
        listOfTermsResult = listOfTerms();
        jj_consume_token(73);
                                                                                                              op2 = token.image;
        break;
      default:
        jj_la1[7] = jj_gen;
        ;
      }
         {if (true) return stringConstantResult + op1 + listOfTermsResult + op2;}
      break;
    case variable:
    case 71:
      variableResult = variable();
         {if (true) return variableResult;}
      break;
    case OMSPositions:
    case OMSaccessibility:
    case OMSVisibility:
    case OMSUnitTypes:
      OMSConstantsResult = OMSConstants();
         {if (true) return OMSConstantsResult;}
      break;
    default:
      jj_la1[8] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public ArrayList<String > action() throws ParseException, THOMASException {

Generate ParseException.

Definition at line 3397 of file NormParser.java.

                                           {
            la1tokens[64+j] = true;
          }
        }
      }
    }
    for (int i = 0; i < 74; i++) {
      if (la1tokens[i]) {
        jj_expentry = new int[1];
        jj_expentry[0] = i;
        jj_expentries.add(jj_expentry);
      }
    }
    jj_endpos = 0;
    jj_rescan_token();
    jj_add_error_token(0, 0);
    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);
  }

  final public void enable_tracing() {
  }

  final public void disable_tracing() {
  }

  private void jj_rescan_token() {
    jj_rescan = true;
    for (int i = 0; i < 9; i++) {
    try {
      JJCalls p = jj_2_rtns[i];

Get the next Token.

Definition at line 3340 of file NormParser.java.

                       {
    if ((jj_nt=token.next) == null)
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);

Get the specific Token.

Definition at line 3349 of file NormParser.java.

                                                     {

id ::= stringConstant

Definition at line 76 of file NormParser.java.

                                                                  {
        String id ="";
    try {
      id = stringConstant();
                                       {if (true) return id;}
    } catch (ParseException e) {
                String message = l10n.getMessage(MessageID.INVALID_ID, e.currentToken.next.beginLine, e.currentToken.next.beginColumn, getNextToken());
                {if (true) throw new InvalidIDException(message);}
    }
    throw new Error("Missing return statement in function");
  }

listOfTerms := term [ “,” term ] ∗

Definition at line 491 of file NormParser.java.

           :
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case 68:
        ;
        break;
      default:
        jj_la1[10] = jj_gen;
        break label_1;
      }
      jj_consume_token(68);
                          coma = token.image;
      term1 = term();
    }
         {if (true) return term + coma + term1;}
    throw new Error("Missing return statement in function");
  }

  final public String term() throws ParseException {

norm ::= "@"id"["deontinc","target","action","activation","expiration"]"

Definition at line 41 of file NormParser.java.

                                                                                {
        Norm norm = null;
        String id, deontic, target, activation, expiration;
        ArrayList<String > targetArray = new ArrayList<String >();
        ArrayList<String > action = new ArrayList<String >();
        ArrayList<String > actionParameters = new ArrayList<String >();
    try {
      jj_consume_token(66);
      id = id();
      jj_consume_token(67);
      deontic = deontic();
      jj_consume_token(68);
      targetArray = target();
      jj_consume_token(68);
      action = action();
      jj_consume_token(68);
      activation = activation();
      jj_consume_token(68);
      expiration = expiration();
      jj_consume_token(69);
            norm = new Norm(id,deontic,targetArray.get(0), targetArray.get(1),action,activation,expiration);
                {if (true) return norm;}
    } catch (ParseException pex) {
            String message = l10n.getMessage(MessageID.INVALID_EXPRESSION,  pex.currentToken.next.beginColumn, getToken(0)+" "+getToken(1)+" "+getToken(2));
                {if (true) throw new InvalidExpressionException(message);}
    } catch (TokenMgrError err) {
                 String message = l10n.getMessage(MessageID.INVALID_EXPRESSION, err.getMessage());
                 {if (true) throw new InvalidExpressionException(message);}
    }
    throw new Error("Missing return statement in function");
  }

numericConstant := [0 − 9]+

Definition at line 862 of file NormParser.java.

                                                             {

numeriConstantPred::=numericConstant |variable

Definition at line 1466 of file NormParser.java.

                                                                                    {

OMSAccesibility ::= “external” |“internal”

Definition at line 1956 of file NormParser.java.

                                                           {

Definition at line 1065 of file NormParser.java.

                                                               {
  String result = "";
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case OMSPositions:
      result = OMSPositions();
          {if (true) return result;}
      break;
    case variable:
    case 71:
      result = variable();
          {if (true) return result;}
      break;
    default:

OMSAction ::= “registerUnit” “(” term “,” term “,” term “,” term “,” term “)” | “deregisterUnit” “(” term “,” term “)” | “registerRole” “(” term “,” term “,” term “,” term “,” term “,” term “)” | “deregisterRole” “(” term “,” term ”,” term “)” | “registerNorm” “(” term “,” term “,” term "," term “)” | “deregisterNorm” “(” term “,” term “,” term ”)” | “allocateRole” “(” term “,” term “,” term “,” term “)” | “deallocateRole” “(” term “,” term “,” term “,” term “)” | “joinUnit” “(” term “,” term “,” term “)” | “informAgentRole” “(” term “,” term “)” |

“informMembers” “(” term “,” term “,” term “,” term “)” | “informQuantityMembers” “(” term “,” term “,” term “,” term “)” | “informUnit” “(” term “,” term “)” | “informUnitRoles” “(” term “,” term “)” | “informTargetNorms” “(” term “,” term “,” term “,” term “)” | “informRole” “(” term “,” term “,” term “)” | “informNorm” “(” term “,” term “,” term “)” | “acquireRole” “(” term “,” term “,” term “)” | “leaveRole” “(” term “,” term “,” term “)” |

Definition at line 1508 of file NormParser.java.

                  {if (true) return resultArray;}
      } catch (ParseException pex) {
                System.out.println("----------------------------------");
        System.out.println("Invalid parameter "+getToken(0)+" in OMS action registerUnit");
                StringBuffer expected = new StringBuffer();
                for (int i = 0; i < pex.expectedTokenSequences.length; i++) {
                for (int j = 0; j < pex.expectedTokenSequences[i].length; j++) {
                        expected.append(tokenImage[pex.expectedTokenSequences[i][j]]).append(' ');
                }
        }

        System.out.println("Expected parameters: "+ expected.toString());
        System.out.println("----------------------------------");
                String message = l10n.getMessage(MessageID.NOT_CREATOR_IN_PARENT_UNIT, "");
                //throw new ParseException(message);
                {if (true) return null;}
      }
      break;
    case deregisterUnit:
      jj_consume_token(deregisterUnit);
                       service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2+ ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        {if (true) return resultArray;}
      break;
    case registerRole:
      jj_consume_token(registerRole);
                         service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = OMSAccessibilityPred();
      jj_consume_token(68);
      param4 = OMSVisibilityPred();
      jj_consume_token(68);
      param5 = OMSPositionsPred();
      jj_consume_token(68);
      param6 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 + ","+ param4 + ","+ param5+"," + param6 +")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        resultArray.add(param4);
        resultArray.add(param5);
        resultArray.add(param6);
        {if (true) return resultArray;}
      break;
    case deregisterRole:
      jj_consume_token(deregisterRole);
                           service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        {if (true) return resultArray;}
      break;
    case registerNorm:
      jj_consume_token(registerNorm);
                         service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = deonticPred();
      jj_consume_token(68);
      param4 = targetTypePred();
      jj_consume_token(68);
      param5 = targetValuePred();
      jj_consume_token(68);
      param6 = OMSActionNamePred();
      jj_consume_token(68);
      param7 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 +","+param4+")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        resultArray.add(param4);
        resultArray.add(param5);
        resultArray.add(param6);
        resultArray.add(param7);

        {if (true) return resultArray;}
      break;
    case deregisterNorm:
      jj_consume_token(deregisterNorm);
                           service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        {if (true) return resultArray;}
      break;
    case allocateRole:
      jj_consume_token(allocateRole);
                         service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = term();
      jj_consume_token(68);
      param4 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 + ","+ param4 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        resultArray.add(param4);
        {if (true) return resultArray;}
      break;
    case deallocateRole:
      jj_consume_token(deallocateRole);
                           service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = term();
      jj_consume_token(68);
      param4 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 + ","+ param4 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        resultArray.add(param4);
        {if (true) return resultArray;}
      break;
    case joinUnit:
      jj_consume_token(joinUnit);
                     service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        {if (true) return resultArray;}
      break;
    case informAgentRole:
      jj_consume_token(informAgentRole);
                            service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        {if (true) return resultArray;}
      break;
    case informMembers:
      jj_consume_token(informMembers);
                          service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = OMSPositionsPred();
      jj_consume_token(68);
      param4 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 + ","+ param4  +")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        resultArray.add(param4);
        {if (true) return resultArray;}
      break;
    case informQuantityMembers:
      jj_consume_token(informQuantityMembers);
                                  service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = OMSPositionsPred();
      jj_consume_token(68);
      param4 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 + ","+ param4 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        resultArray.add(param4);
        {if (true) return resultArray;}
      break;
    case informUnit:
      jj_consume_token(informUnit);
                        service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        {if (true) return resultArray;}
      break;
    case informUnitRoles:
      jj_consume_token(informUnitRoles);
                            service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        {if (true) return resultArray;}
      break;
    case informTargetNorms:
      jj_consume_token(informTargetNorms);
                              service = token.image;
      jj_consume_token(72);
      param1 = targetTypePred();
      jj_consume_token(68);
      param2 = targetValuePred();
      jj_consume_token(68);
      param3 = term();
      jj_consume_token(68);
      param4 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 + ","+ param4 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        resultArray.add(param4);
        {if (true) return resultArray;}
      break;
    case informRole:
      jj_consume_token(informRole);
                       service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        {if (true) return resultArray;}
      break;
    case informNorm:
      jj_consume_token(informNorm);
                       service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 +  ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        {if (true) return resultArray;}
      break;
    case acquireRole:
      jj_consume_token(acquireRole);
                         service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        {if (true) return resultArray;}
      break;
    case leaveRole:
      jj_consume_token(leaveRole);
                       service = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = term();
      jj_consume_token(73);
        resultArray.add(service);
        result = service +"("+ param1 + ","+ param2 + ","+ param3 + ")";
        resultArray.add(result);
        resultArray.add(param1);
        resultArray.add(param2);
        resultArray.add(param3);
        {if (true) return resultArray;}
      break;
    default:
      jj_la1[36] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String OMSConstants() throws ParseException {
  String result = "";
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case OMSPositions:
      /* OMSPositions() | OMSaccessibility() | OMSVisibility() |  OMSUnitTypes() | < virtual > | < participant >*/
      
                result = OMSPositions();
                                    {if (true) return result;}
      break;
    case OMSaccessibility:

OMSActionName ::= “registerUnit” |“deregisterUnit” |“registerRole” |“deregisterRole” |“registerNorm” |“deregisterNorm” |“allocateRole” |“deallocateRole” |“joinUnit” |“informAgentRole” |“informMembers” |“informQuantityMembers” |“informUnit” |“informUnitRoles” |“informTargetNorms” |“informRole” |“informNorm” |“acquireRole” |“leaveRole”

Definition at line 1315 of file NormParser.java.

                       :
      jj_consume_token(deregisterRole);
                           {if (true) return token.image;}
      break;
    case registerNorm:
      jj_consume_token(registerNorm);
                         {if (true) return token.image;}
      break;
    case deregisterNorm:
      jj_consume_token(deregisterNorm);
                           {if (true) return token.image;}
      break;
    case allocateRole:
      jj_consume_token(allocateRole);
                         {if (true) return token.image;}
      break;
    case deallocateRole:
      jj_consume_token(deallocateRole);
                           {if (true) return token.image;}
      break;
    case joinUnit:
      jj_consume_token(joinUnit);
                     {if (true) return token.image;}
      break;
    case informAgentRole:
      jj_consume_token(informAgentRole);
                            {if (true) return token.image;}
      break;
    case informMembers:
      jj_consume_token(informMembers);
                          {if (true) return token.image;}
      break;
    case informQuantityMembers:
      jj_consume_token(informQuantityMembers);
                                  {if (true) return token.image;}
      break;
    case informUnit:
      jj_consume_token(informUnit);
                        {if (true) return token.image;}
      break;
    case informUnitRoles:
      jj_consume_token(informUnitRoles);
                            {if (true) return token.image;}
      break;
    case informTargetNorms:
      jj_consume_token(informTargetNorms);
                              {if (true) return token.image;}
      break;
    case informRole:
      jj_consume_token(informRole);
                       {if (true) return token.image;}
      break;
    case informNorm:
      jj_consume_token(informNorm);
                       {if (true) return token.image;}
      break;
    case acquireRole:
      jj_consume_token(acquireRole);
                         {if (true) return token.image;}
      break;
    case leaveRole:
      jj_consume_token(leaveRole);
                       {if (true) return token.image;}
      break;
    default:
      jj_la1[33] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String OMSRoleEnactPred() throws ParseException {
        String result = "";
        String param1 = "", param2 = "", param3 = "";
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case isAgent:
      jj_consume_token(isAgent);
                    result = token.image;
      jj_consume_token(72);
      param1 = term();

Definition at line 1271 of file NormParser.java.

                              :
    case informUnit:
    case informUnitRoles:
    case informTargetNorms:
    case informRole:
    case informNorm:
    case acquireRole:
    case leaveRole:
      result = OMSActionName();
                                 {if (true) return result;}
      break;
    case variable:
    case 71:
      result = variable();
                       {if (true) return result;}
      break;
    default:
      jj_la1[32] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String OMSActionName() throws ParseException {
  String result = "";
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case registerUnit:
      jj_consume_token(registerUnit);
                         {if (true) return token.image;}
      break;

normContent ::=“[” (deontic |“ ”) “,” ( targetContent |“ ”) “,” (action |“ ”) “,” activation “,” expiration “]” | "_" OMSCondition ::= OMSUnitPred |OMSRolesPred |OMSNormsPred |OMSRoleEnactPred

Definition at line 902 of file NormParser.java.

         {if (true) return result;}
      break;
    case isNorm:
    case hasDeontic:
    case hasTarget:
    case hasAction:
      result = OMSNormsPred();
         {if (true) return result;}
      break;
    case isAgent:
    case playsRole:
    case roleCardinality:
    case positionCardinality:
      result = OMSRoleEnactPred();
         {if (true) return result;}
      break;
    default:
      jj_la1[21] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String OMSUnitPred() throws ParseException {
        String result = "";
        String param1, param2;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case isUnit:
      jj_consume_token(isUnit);
                   result = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(73);

OMSConstants ::= OMSPositions |OMSAccesibility |OMSVisibility |OMSUnitTypes

Definition at line 1914 of file NormParser.java.

                                       {if (true) return result;}
      break;
    case OMSUnitTypes:
      result = OMSUnitTypes();
                                      {if (true) return result;}
      break;
    default:
      jj_la1[37] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String OMSPositions() throws ParseException {
   String variable="";
    jj_consume_token(OMSPositions);
          {if (true) return token.image;}
    throw new Error("Missing return statement in function");
  }

“ isNorm” “(” term , term “)” |“hasDeontic” “(” term , term , term “)” | "hasTarget" "("term, term, term, term ")" | "hasAction" "("term, term, term")"

Definition at line 1129 of file NormParser.java.

                   :
      jj_consume_token(hasDeontic);
                           result = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = deonticPred();
      jj_consume_token(73);
         {if (true) return result = result + "("+param1+","+ param2+","+ param3+")";}
      break;
    case hasTarget:
      jj_consume_token(hasTarget);
                          result = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = targetTypePred();
      jj_consume_token(68);
      param4 = targetValuePred();
      jj_consume_token(73);
         {if (true) return result = result + "("+param1+","+ param2+","+ param3+","+param4+")";}
      break;
    case hasAction:
      jj_consume_token(hasAction);
                          result = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = OMSActionNamePred();
      jj_consume_token(73);
         {if (true) return result = result + "("+param1+","+ param2+","+ param3+")";}
      break;
    default:
      jj_la1[28] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String deonticPred() throws ParseException {
  String result = "";
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case deontic:
      jj_consume_token(deontic);
         {if (true) return token.image;}
      break;
    case variable:
    case 71:
      result = variable();

OMSPositions ::= “creator” |“member” |“supervisor” |“subordinate”

Definition at line 1946 of file NormParser.java.

                                                            {

Definition at line 1085 of file NormParser.java.

                                                                {
  String result = "";
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case OMSVisibility:
      result = OMSVisibility();
          {if (true) return result;}
      break;
    case variable:
    case 71:
      result = variable();
          {if (true) return result;}
      break;
    default:

“ isAgent” “(” term “)” |“playsRole” “(” term “,” term “,” term “)” |“roleCardinality” “(” term “,” term “,” term “)” |“positionCardinality” “(” term “,” term “,” term “)”

Definition at line 1406 of file NormParser.java.

                                        {if (true) return result =  result +"("+param1+ ","+param2+ ","+param3+ ")";}
      break;
    case roleCardinality:
      jj_consume_token(roleCardinality);
                               result = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = numericConstantPred();
      jj_consume_token(73);
                                        {if (true) return result =  result +"("+param1+ ","+param2+ ","+param3+ ")";}
      break;
    case positionCardinality:
      jj_consume_token(positionCardinality);
                                   result = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = numericConstantPred();
      jj_consume_token(73);
                                        {if (true) return result =  result +"("+param1+ ","+param2+ ","+param3+ ")";}
      break;
    default:
      jj_la1[34] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String numericConstantPred() throws ParseException {
  String result = "";
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case numericConstant:
      result = numericConstant();
                                   {if (true) return result;}
      break;
    case variable:
    case 71:

“ isRole” “(” term “,” term “)” |“hasAccesibility” “(” term “,” term “,” term “)” |“hasVisibility” “(” term “,” term “,” term “)” |“hasPosition” “(” term “,” term “,” term “)”

Definition at line 1007 of file NormParser.java.

                         :
      jj_consume_token(hasAccessibility);
                               result = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = OMSAccessibilityPred();
      jj_consume_token(73);
         {if (true) return result = result + "("+param1+","+param2+","+param3+")";}
      break;
    case hasVisibility:
      jj_consume_token(hasVisibility);
                            result = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = OMSVisibilityPred();
      jj_consume_token(73);
         {if (true) return result = result + "("+param1+","+param2+","+param3+")";}
      break;
    case hasPosition:
      jj_consume_token(hasPosition);
                          result = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(68);
      param3 = OMSPositionsPred();
      jj_consume_token(73);
         {if (true) return result = result + "("+param1+","+param2+","+param3+")";}
      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 OMSAccessibilityPred() throws ParseException {
  String result = "";
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case OMSaccessibility:
      result = OMSaccessibility();
          {if (true) return result;}
      break;
    case variable:
    case 71:
      result = variable();
          {if (true) return result;}
      break;
    default:

OMSUnitPred ::= “isUnit” “(” term “)” |“hasType” “(” term “,” term “)” |“hasParent” “(” term “,” term “)”

Definition at line 943 of file NormParser.java.

         {if (true) return result = result + "("+param1+","+param2+")";}
      break;
    case hasParent:
      jj_consume_token(hasParent);
                        result = token.image;
      jj_consume_token(72);
      param1 = term();
      jj_consume_token(68);
      param2 = term();
      jj_consume_token(73);
         {if (true) return result = result + "("+param1+","+param2+")";}
      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 OMSUnitTypesPred() throws ParseException {
  String result = "";
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case OMSUnitTypes:
      result = OMSUnitTypes();
                {if (true) return result;}
      break;
    case variable:
    case 71:
      result = variable();
          {if (true) return result;}
      break;
    default:

OMSUnitTypes ::= “flat” |“team” |“hierarchy”

Definition at line 1976 of file NormParser.java.

        { return !jj_3_1(); }
    catch(LookaheadSuccess ls) { return true; }
    finally { jj_save(0, xla); }
  }

  private boolean jj_2_2(int xla) {
    jj_la = xla; jj_lastpos = jj_scanpos = token;
    try { return !jj_3_2(); }
    catch(LookaheadSuccess ls) { return true; }
    finally { jj_save(1, xla); }
  }

Definition at line 983 of file NormParser.java.

                                                           {
  String result = "";
  String param1, param2, param3;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case isRole:
      jj_consume_token(isRole);
                   result = token.image;
      jj_consume_token(72);
      param1 = term();

OMSVisibility ::= “public” |“private”

Definition at line 1966 of file NormParser.java.

          {if (true) return token.image;}
    } catch (ParseException pex) {
        System.out.println("Unit type not found: "+ getNextToken());
        {if (true) return null;}
    }
    throw new Error("Missing return statement in function");

Definition at line 1105 of file NormParser.java.

                                                           {
  String result="";
  String param1, param2, param3, param4;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case isNorm:
      jj_consume_token(isNorm);
                    result = token.image;
      jj_consume_token(72);
      param1 = term();

Definition at line 22 of file NormParser.java.

        {
          try
          {

          l10n = new THOMASMessages();

          return norm();
          }
          catch(TokenMgrError err)
      {
                 String message = l10n.getMessage(MessageID.INVALID_EXPRESSION, err.getMessage());
                 throw new InvalidExpressionException(message);
       }
   }
void es.upv.dsic.gti_ia.norms.NormParser.ReInit ( java.io.InputStream  stream)

Reinitialise.

Definition at line 3235 of file NormParser.java.

                                           {
    jj_input_stream = new SimpleCharStream(stream, 1, 1);
void es.upv.dsic.gti_ia.norms.NormParser.ReInit ( java.io.InputStream  stream,
String  encoding 
)

Reinitialise.

Definition at line 3239 of file NormParser.java.

                                            {
void es.upv.dsic.gti_ia.norms.NormParser.ReInit ( java.io.Reader  stream)

Reinitialise.

Definition at line 3261 of file NormParser.java.

                                                {
    token_source = tm;

Reinitialise.

Definition at line 3282 of file NormParser.java.

                            {
      jj_gen++;
      if (++jj_gc > 100) {
        jj_gc = 0;
        for (int i = 0; i < jj_2_rtns.length; i++) {
          JJCalls c = jj_2_rtns[i];
          while (c != null) {
            if (c.gen < jj_gen) c.first = null;

relExpression := relTerm [ ( “ < ” |“ > ” |“==” |“! =” “ <= ” |“ >= ” ) relTerm ]+

Definition at line 644 of file NormParser.java.

                                   :jj_ntk) {
      case LESS:
        jj_consume_token(LESS);
                                       operator = token.image;
        break;
      case HIGHER:
        jj_consume_token(HIGHER);
                                                                             operator = token.image;
        break;
      case EQUAL:
        jj_consume_token(EQUAL);
                                                                                                                 operator = token.image;
        break;
      case NOTEQUAL:
        jj_consume_token(NOTEQUAL);
                                                                                                                                                        operator = token.image;
        break;
      case LESSOREQUAL:
        jj_consume_token(LESSOREQUAL);
                                                                                                                                                                                                  operator = token.image;
        break;
      case HIGHEROREQUAL:
        jj_consume_token(HIGHEROREQUAL);
                                                                                                                                                                                                                                             operator = token.image;
        break;
      default:
        jj_la1[14] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      relTerm2 = relTerm();
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case NOTEQUAL:
      case EQUAL:
      case LESS:
      case LESSOREQUAL:
      case HIGHER:
      case HIGHEROREQUAL:
        ;
        break;
      default:
        jj_la1[15] = jj_gen;
        break label_2;
      }
    }
         {if (true) return relTerm1 + operator + relTerm2;}
    throw new Error("Missing return statement in function");
  }

  final public String relTerm() throws ParseException, THOMASException {

relTerm := genAtomicFormula |arithExpression

Definition at line 701 of file NormParser.java.

                                   {
      result = genAtomicFormula();
   {if (true) return result;}
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String arithExpression() throws ParseException {

simpleExpression := genAtomicCondition |relExpression

Definition at line 626 of file NormParser.java.

                                   {
      result = genAtomicCondition();
         {if (true) return result;}
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String relExpression() throws ParseException, THOMASException {

stringConstant := [a − z] ([0 − Z])∗

Definition at line 871 of file NormParser.java.

                                                                            {

target ::= "< "targetType ":" value " >"

Definition at line 117 of file NormParser.java.

        {
      if (jj_2_1(2)) {
        jj_consume_token(LESS);
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case agentName:
          jj_consume_token(agentName);
                               targetType = token.image;
          break;
        case roleName:
          jj_consume_token(roleName);
                                                                         targetType = token.image;
          break;
        default:
          jj_la1[0] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
        jj_consume_token(70);
        try {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case numericConstant:
          case stringConstant:
            value = constant();
            break;
          case 71:
            jj_consume_token(71);
                                                   value = token.image;
            break;
          default:
            jj_la1[1] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        } catch (ParseException pex) {
                        String message = l10n.getMessage(MessageID.INVALID_TARGET_VALUE,  pex.currentToken.next.beginColumn,  getToken(1));
                        {if (true) throw new InvalidTargetValueException(message);}
        }
        jj_consume_token(HIGHER);
                target.add(targetType);
                target.add(value);
                {if (true) return target;}
      } else if (jj_2_2(2)) {
        jj_consume_token(LESS);
        jj_consume_token(positionName);
                                 targetType = token.image;
        jj_consume_token(70);
        try {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case OMSPositions:
            value = OMSPositions();
            break;
          case 71:
            jj_consume_token(71);
                                                       value = token.image;
            break;
          default:
            jj_la1[2] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
          jj_consume_token(HIGHER);
        } catch (ParseException pex) {
                        String message = l10n.getMessage(MessageID.INVALID_TARGET_VALUE,  pex.currentToken.next.beginColumn, getToken(1));
                        {if (true) throw new InvalidTargetValueException(message);}
        }
                target.add(targetType);
                        target.add(value);
                        {if (true) return target;}
      } else {
        jj_consume_token(-1);
        throw new ParseException();
      }
    } catch (ParseException pex) {
                String message = l10n.getMessage(MessageID.INVALID_TARGET_TYPE,  pex.currentToken.next.beginColumn, getToken(2));
                {if (true) throw new InvalidTargetTypeException(message);}
    }
    throw new Error("Missing return statement in function");
  }

targetTypeName := targetType | "_"

Definition at line 1215 of file NormParser.java.

                 :
    case 71:
      result = variable();
                       {if (true) return result;}
      break;
    default:
      jj_la1[30] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String targetValuePred() throws ParseException {
  String result = "";
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case OMSPositions:
      result = OMSPositions();
                                 {if (true) return result;}
      break;
    case numericConstant:
    case stringConstant:
      result = constant();

valueTypeName := OMSPositions |constant |variable

Definition at line 1246 of file NormParser.java.

                       {if (true) return result;}
      break;
    default:
      jj_la1[31] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String OMSActionNamePred() throws ParseException {
  String result = "";
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case registerUnit:
    case deregisterUnit:
    case registerRole:
    case deregisterRole:
    case registerNorm:
    case deregisterNorm:
    case allocateRole:
    case deallocateRole:
    case joinUnit:
    case informAgentRole:

term := constant |variable |OMSConstants

Definition at line 517 of file NormParser.java.

                                 :jj_ntk) {
    case numericConstant:
    case stringConstant:
      constantString = constant();
                               {if (true) return constantString;}
      break;
    case variable:
    case 71:
      variableString = variable();
                                  {if (true) return variableString;}
      break;
    case OMSPositions:
    case OMSaccessibility:
    case OMSVisibility:
    case OMSUnitTypes:
      OMSConstantsString = OMSConstants();
                                          {if (true) return OMSConstantsString;}
      break;
    default:
      jj_la1[11] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

targetType := “agentName” |“roleName” |“positionName” value := stringConstant | "_"

Definition at line 330 of file NormParser.java.

          {if (true) return result;}
      break;
    case 71:
      jj_consume_token(71);
               {if (true) return token.image;}
      break;
    default:
      jj_la1[5] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String genAtomicCondition() throws ParseException, THOMASException {

variable := [A − Z] ([0 − Z])∗ |“_”

Definition at line 819 of file NormParser.java.

           :
      jj_consume_token(71);
               {if (true) return token.image;}
      break;
    default:
      jj_la1[19] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String constant() throws ParseException {

Member Data Documentation

Next token.

Definition at line 3192 of file NormParser.java.

Current token.

Definition at line 3190 of file NormParser.java.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables