Exemplo n.º 1
0
 public boolean parse(
     int level, Source source, boolean parentNot, boolean caseSensitive, boolean receive) {
   data.pushDefaultSyntaxError();
   boolean match = element.parse(level, source, parentNot, caseSensitive, receive);
   data.popDefaultSyntaxError();
   return match;
 }
Exemplo n.º 2
0
  // parse
  public ParsingResult parse(Source source) throws ParserException {
    net.sf.laja.parser.engine2.element.Element element = getGrammar1();

    boolean match = element.parse(0, source, false, true, false);
    int bestIndex = source.getBestIndex();

    if (match && source.reachedEnd()) {
      source.reset();
      element = getGrammar2();
      match = element.parse(0, source, false, true, true);
      if (!match) {
        throw new IllegalStateException(
            "The parsing result was true in phase 1, but false in phase 2.");
      }
      return new ParsingResult(true, source, syntaxErrorHandler);
    } else if (sourceRecorderLogWriter != null) {
      source.reset();
      source.getRecorder().setLogging(sourceRecorderLogWriter, bestIndex);
      element.parse(0, source, false, true, false);
    }

    return new ParsingResult(false, source, element, syntaxErrorHandler);
  }
Exemplo n.º 3
0
 public boolean isTerminal() {
   return element.isTerminal();
 }
Exemplo n.º 4
0
 public String getIdName() {
   return element.getIdName();
 }
Exemplo n.º 5
0
 public String getString() {
   return element.getString();
 }
Exemplo n.º 6
0
 public int getId() {
   return element.getId();
 }