Package statechum.analysis.learning.rpnicore.LTL_to_ba

Examples of statechum.analysis.learning.rpnicore.LTL_to_ba.Lexer


  /** Junk at the end of term which can be retrieved. */
  @Test
  public void testParse0c()
  {
    final String text = "\'this is an atom\' junk and more";
      Lexer lexer = ErlangLabel.buildLexer(text);
      OtpErlangObject result = ErlangLabel.parseFirstTermInText(lexer);
    OtpErlangAtom atom = (OtpErlangAtom)result;
    Assert.assertEquals("\'this is an atom\'",ErlangLabel.dumpErlangObject(atom));
    Assert.assertEquals("junk and more",lexer.remaining());
  }
View Full Code Here


  /** Junk at the end of term which can be retrieved. */
  @Test
  public void testParse0c()
  {
    final String text = "\'this is an atom\' junk and more";
      Lexer lexer = ErlangLabel.buildLexer(text);
      OtpErlangObject result = ErlangLabel.parseFirstTermInText(lexer);
    OtpErlangAtom atom = (OtpErlangAtom)result;
    Assert.assertEquals("\'this is an atom\'",ErlangLabel.dumpErlangObject(atom));
    Assert.assertEquals("junk and more",lexer.remaining());
  }
View Full Code Here

  public static final int erlDot = 21;
  public static final int erlE = 22;
  public static final int erlText = 23;

  public static Lexer buildLexer(String whatToParse) {
    return new Lexer("(\\s*\\{\\s*)|" + // erlTupleBegin
        "(\\s*}\\s*)|" + // erlTupleEnd
        "(\\s*\\[\\s*)|" + // erlListBegin
        "(\\s*]\\s*)|" + // erlListEnd
        "(\\s*<<\\s*)|" + // erlBitStrBegin
        "(\\s*>>\\s*)|" + // erlBitStrEnd
View Full Code Here

   * @param str
   *            text to parse
   * @return the outcome.
   */
  public static OtpErlangObject parseText(String str) {
    Lexer lexer = buildLexer(str);
    OtpErlangObject result = parseFirstTermInText(lexer);
    if (lexer.getLastMatchType() >= 0)// did not get to the end of string
      throw new IllegalArgumentException(
          "unexpected characters at the end of string to parse, looking at "
              + lexer.remaining());
    return result;
  }
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.rpnicore.LTL_to_ba.Lexer

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.