Examples of Lexer


Examples of galoot.lexer.Lexer

    public Template(Reader reader) throws IOException
    {
        try
        {
            // TODO decide if there is a better buffer size
            Lexer lexer = new Lexer(new PushbackReader(reader, 1024));
            Parser parser = new Parser(lexer);
            templateAST = parser.parse();
        }
        catch (ParserException e)
        {
View Full Code Here

Examples of gherkin.lexer.Lexer

        machinePath = "/gherkin/parser/" + name + ".txt";
    }

    public List<List<String>> transitionTable() {
        transitionTable = new ArrayList<List<String>>();
        Lexer lexer = new En(this);
        lexer.scan(FixJava.readResource(machinePath));
        return transitionTable;
    }
View Full Code Here

Examples of lexer.Lexer

    // helper method to run tests; no need to change this
    // In any case making them final makes no sense since the accessor is private.
    // private final void runtest(String input, Token... output) {
    // "..." arbitrage number of parameters
    private void runtest(String input, Token... output) {
        Lexer lexer = new Lexer(new StringReader(input));
        int i=0;
        Token actual, expected;
        try {
            do {
                //System.out.println("testing "+output[i]);
                assertTrue(i < output.length);
                expected = output[i++];
                try {
                    actual = lexer.nextToken();
                    assertEquals(expected, actual);
                } catch(Error e) {
                    if(expected != null)
                        fail(e.getMessage());
                    return;
View Full Code Here

Examples of net.sf.cb2xml.sablecc.lexer.Lexer

     * @return a copybook instance containing the parse tree for the definition
     */
    public static Copybook parse(String name, Reader reader)
    {       
        Copybook document = null;
        Lexer lexer = null;
        try {
            String preProcessed = CobolPreprocessor.preProcess(reader);
            StringReader sr = new StringReader(preProcessed);
            PushbackReader pbr = new PushbackReader(sr, 1000);
           
            if (debug) {
                lexer = new DebugLexer(pbr);
            } else {
                lexer = new Lexer(pbr);
            }
           
            Parser parser = new Parser(lexer);
            Start ast = parser.parse();
            CopybookAnalyzer copyBookAnalyzer = new CopybookAnalyzer(name, parser);
View Full Code Here

Examples of net.sourceforge.processdash.data.compiler.lexer.Lexer

        defineDecls = (String) defineDeclarations.get(filename);
      defineDecls = prependGlobalDefineDeclarations(defineDecls);

      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 net.sourceforge.processdash.data.compiler.lexer.Lexer

    public static PValue compileVal(String expression)
        throws CompilationException
    {
        try {
            // Create a Parser instance.
            Parser p = new Parser(new Lexer(new PushbackReader
                (new StringReader("[foo] = " + expression + ";"), 1024)));

            // Parse the input
            Start tree = p.parse();
View Full Code Here

Examples of net.sourceforge.processdash.util.glob.lexer.Lexer

    private static Start compile(String expression) {
        Start result = (Start) COMPILED_EXPRESSIONS.get(expression);
        if (result == null) {
            try {
                Parser p = new Parser(new Lexer(new PushbackReader(
                        new StringReader(expression), 1024)));

                // Parse the input
                result = p.parse();
            } catch (Exception e) {
View Full Code Here

Examples of org.ajax4jsf.org.w3c.tidy.Lexer

      log.debug(Messages.getMessage(Messages.MESSAGE_PARSING_INFO,
          message.getMessage()));
    }
    // TODO - configurable output for reeors in page.
    if (false) {
      Lexer lexer = message.getLexer();
      Node element = message.getElement();
      if (null == element) {
        element = lexer.getLastNode();
      } else if ("style".equalsIgnoreCase(element.getElement())
          || "script".equalsIgnoreCase(element.getElement())) {
        element = lexer.getLastNode();
      }
      // Insert comment about error.
      if (null != element) {
        String messageText = message.getMessage();
        byte[] msg = (TIDY_MARK + messageText + TIDY_MARK).getBytes();
        Node comment = lexer.newNode(Node.COMMENT_TAG, msg, 0,
            msg.length);
        // TODO - detect style or script elements - not allow comment in
        // it.
        element.insertNodeAtEnd(comment);
      }
View Full Code Here

Examples of org.ajax4jsf.org.w3c.tidy.Lexer

      log.debug(Messages.getMessage(Messages.MESSAGE_PARSING_INFO,
          message.getMessage()));
    }
    // TODO - configurable output for reeors in page.
    if (false) {
      Lexer lexer = message.getLexer();
      Node element = message.getElement();
      if (null == element) {
        element = lexer.getLastNode();
      } else if ("style".equalsIgnoreCase(element.getElement())
          || "script".equalsIgnoreCase(element.getElement())) {
        element = lexer.getLastNode();
      }
      // Insert comment about error.
      if (null != element) {
        String messageText = message.getMessage();
        byte[] msg = (TIDY_MARK + messageText + TIDY_MARK).getBytes();
        Node comment = lexer.newNode(Node.COMMENT_TAG, msg, 0,
            msg.length);
        // TODO - detect style or script elements - not allow comment in
        // it.
        element.insertNodeAtEnd(comment);
      }
View Full Code Here

Examples of org.andromda.translation.ocl.lexer.Lexer

    protected void process(final String expression) throws IOException
    {
        ExceptionUtils.checkEmpty("expression", expression);
        try
        {
            Lexer lexer = new Lexer(new PushbackReader(new StringReader(expression)));
            OclParser parser = new OclParser(lexer);
            Start startNode = parser.parse();
            this.translatedExpression = new Expression(expression);
            startNode.apply(this);
        }
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.