Examples of Lexer


Examples of org.jrubyparser.lexer.Lexer

        }
        return null;
    }

    private Properties collectDocNodes(File file) throws IOException {
        Lexer lexer = new Lexer();
        lexer.setSource(LexerSource.getSource(file.getName(), new FileReader(file), new ParserConfiguration()));
        lexer.setPreserveSpaces(true);
        lexer.setWarnings(new Parser.NullWarnings());
        String doc;
        int token = -1;
        Properties props = new Properties();
        while (lexer.advance()) {
            if (token == -1)
                token = lexer.token();
            if (token == Tokens.tDOCUMENTATION) {
                doc = "=" + lexer.getTokenBuffer().toString();
                while (lexer.advance() && (token = lexer.token()) == Tokens.tWHITESPACE) {
                }
                if (token != Tokens.kDEF)
                    continue;
                while (lexer.advance() && (token = lexer.token()) == Tokens.tWHITESPACE) {
                }
                if (token != Tokens.tIDENTIFIER)
                    continue;
                props.setProperty(lexer.getTokenBuffer().toString(), doc);
            }
            token = -1;
        }
        return props;
    }
View Full Code Here

Examples of org.objectweb.joram.shared.selectors.Lexer

  {
    if (selector == null || selector.equals(""))
      return true;

    try {
      Checker checker = new Checker(new Lexer(selector));
      return ((Boolean) checker.parse().value).booleanValue();
    } catch (SelectorException sE) {
      throw sE;
    } catch (Throwable t) {
      throw new SelectorException("Invalid selector: " + t.getMessage());
View Full Code Here

Examples of polyglot.lex.Lexer

    public String compilerName() {
        return "jeddc";
    }

    public Parser parser(Reader reader, FileSource source, ErrorQueue eq) {
        Lexer lexer = new Lexer_c(reader, source.name(), eq);
        Grm grm = new Grm(lexer, ts, nf, eq);
        return new CupParser(grm, source, eq);
    }
View Full Code Here

Examples of pspdash.data.compiler.lexer.Lexer

      if (filename != null)
        defineDecls = (String) defineDeclarations.get(filename);

      try {
        CppFilterReader readIn = new CppFilterReader(in, defineDecls);
        Parser p = new Parser(new Lexer(new PushbackReader(readIn, 1024)));

        // Parse the file.
        Start tree = p.parse();

        // Apply the file loader.
View Full Code Here

Examples of rex.olap.mdxparse.Lexer

         mdx = mdx.replaceAll("\r", "");
           try {

           parser parser_obj;
           Reader reader = new StringReader(mdx);
           parser_obj = new parser(new Lexer(reader));

           Symbol parse_tree = null;
           ParsedQuery pQuery = null;
          
           parse_tree = parser_obj.parse();
View Full Code Here

Examples of ru.snake.spritepacker.writer.lexer.Lexer

    lineExpression = null;
    footerExpression = null;
  }

  public void prepareHeader(String textExpression) {
    Lexer lexer = new Lexer(textExpression);
    List<Token> tokens = lexer.getTokens();
    Parser parser = new Parser(tokens);
    headerExpression = parser.parse();

    headerExpression.visit(variableMap);
  }
View Full Code Here

Examples of sicel.compiler.parser.Lexer

    }
  }
 
  public static void main(String[] args) throws IOException
  {
    Lexer lexer = new LexerImpl();
    lexer.initialize( new File( "input.txt" ) );
    //System.out.println( lexer.lookAhead( 30 ) );
   
    Token t;
    while( ( t = lexer.take() ) != null )
    {
      System.out.println( t );
    }
   
    //System.out.println( lexer.lookAhead( 4 ) );
View Full Code Here

Examples of stanfordlogic.gdl.Lexer

  public void testLexer()
  {
    ByteArrayInputStream input = new ByteArrayInputStream( (new String("hello there")).getBytes() );
    SymbolTable symtab = new SymbolTable();
   
    Lexer l = new Lexer(input, symtab);
   
    assertTrue( l.token() > 255 );
    assertTrue( l.token() > 255 );
    assertEquals( -1, l.token() );
   
    assertEquals(2, symtab.size() );
  }
View Full Code Here

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

  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

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

   * @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
Copyright © 2018 www.massapi.com. 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.