Package net.sf.laja.parser.engine2

Examples of net.sf.laja.parser.engine2.RecorderLoggingImpl$Data


     *
     * @return Contentinfo with contentType Data.
     */
    private ContentInfo makeData(SafeContents safe) throws IOException,
      ASN1Exception {
  Data data = null;
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  DEREncoder encoder = new DEREncoder(baos);
  safe.encode(encoder);
  data = new Data(baos.toByteArray());
  baos.close();
  ContentInfo cInfo = new ContentInfo(data);
  return cInfo;
    }
View Full Code Here


  // check version before any other operations
  Request request = new Request (display, major_opcode, 0, 3);
  request.write4 (CLIENT_MAJOR_VERSION);
  request.write4 (CLIENT_MINOR_VERSION);

  Data reply = display.read_reply (request);
  server_major_version = reply.read4 (8);
  server_minor_version = reply.read4 (12);
    }
View Full Code Here

     */
    public long getOverlayWindow (Window win) {
  Request request = new Request (display, major_opcode, 7, 2);
  request.write4 (win.id);

  Data reply = display.read_reply (request);
  if (reply == null) {
      return -1;
  }

  return reply.read4(8);
    }
View Full Code Here

    // check version before any other operations
    Request request = new Request (display, major_opcode, 0, 3);
    request.write4 (CLIENT_MAJOR_VERSION);
    request.write4 (CLIENT_MINOR_VERSION);
 
    Data reply = display.read_reply (request);
    server_major_version = reply.read2 (8);
    server_minor_version = reply.read2 (10);
  }
View Full Code Here

      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);
  }
View Full Code Here

        return new ExpressionFactory();
      }
    });
   
    try {
      ParsingResult result = parser.parseFile(inputFile);
     
      if (result.success()) {
        Expression exp = ((ExpressionFactory)parser.getFactory()).getExp();
        System.out.println("Result=" + exp.calculate());
      } else {
        System.out.println(result.toString());
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

            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);
    }
View Full Code Here

            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);
    }
View Full Code Here

      public IGrammarFactory getFactory(int phase) {
        return new ParserFactory(writer);
      }}
    );
 
    ParsingResult result = parser.parseFile(grammarFile);

    if (result.success()) {
      Grammar grammar = ((ParserFactory)parser.getFactory()).getGrammar();
      return grammar.getGeneratorResult(parsingSettings);
    }
    throw new ParserException("Could not generate grammar: " + result);
  }
View Full Code Here

            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);
    }
View Full Code Here

TOP

Related Classes of net.sf.laja.parser.engine2.RecorderLoggingImpl$Data

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.