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

List of all members.

Public Member Functions

 ParseException (Token currentTokenVal, int[][] expectedTokenSequencesVal, String[] tokenImageVal)
 ParseException ()
 ParseException (String message)

Public Attributes

Token currentToken
int[][] expectedTokenSequences
String[] tokenImage

Protected Attributes

String eol = System.getProperty("line.separator", "\n")

Static Package Functions

static String add_escapes (String str)

Detailed Description

This exception is thrown when parse errors are encountered. You can explicitly create objects of this exception type by calling the method generateParseException in the generated parser.

You can modify this class to customize your error reporting mechanisms so long as you retain the public fields.

Definition at line 14 of file ParseException.java.


Constructor & Destructor Documentation

es.upv.dsic.gti_ia.norms.ParseException.ParseException ( Token  currentTokenVal,
int  expectedTokenSequencesVal[][],
String[]  tokenImageVal 
)

This constructor is used by the method "generateParseException" in the generated parser. Calling this constructor generates a new object of this type with the fields "currentToken", "expectedTokenSequences", and "tokenImage" set.

Definition at line 29 of file ParseException.java.

  {
    super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));
    currentToken = currentTokenVal;
    expectedTokenSequences = expectedTokenSequencesVal;
    tokenImage = tokenImageVal;
  }

The following constructors are for use by you for whatever purpose you can think of. Constructing the exception in this manner makes the exception behave in the normal way - i.e., as documented in the class "Throwable". The fields "errorToken", "expectedTokenSequences", and "tokenImage" do not contain relevant information. The JavaCC generated code does not use these constructors.

Definition at line 50 of file ParseException.java.

                          {
    super();
  }

Constructor with message.

Definition at line 55 of file ParseException.java.

                                        {
    super(message);
  }

Member Function Documentation

static String es.upv.dsic.gti_ia.norms.ParseException.add_escapes ( String  str) [static, package]

Used to convert raw characters to their escaped version when these raw version cannot be used as part of an ASCII string literal.

Definition at line 141 of file ParseException.java.

                                        {
      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();
   }

Member Data Documentation

This is the last token that has been consumed successfully. If this object has been created due to a parse error, the token followng this token will (therefore) be the first error token.

Definition at line 65 of file ParseException.java.

String es.upv.dsic.gti_ia.norms.ParseException.eol = System.getProperty("line.separator", "\n") [protected]

The end of line string for this machine.

Definition at line 134 of file ParseException.java.

Each entry in this array is an array of integers. Each array of integers represents a sequence of tokens (by their ordinal values) that is expected at this point of the parse.

Definition at line 72 of file ParseException.java.

This is a reference to the "tokenImage" array of the generated parser within which the parse error occurred. This array is defined in the generated ...Constants interface.

Definition at line 79 of file ParseException.java.


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