Exemple #1
0
        static void Main(string[] args)
        {
            Start:
            Console.Write("> ");
            string data = Console.ReadLine();

            TemplateLexer lexer = new TemplateLexer(data);
            do
            {
                Token token = lexer.Next();
                Console.WriteLine("{0} ({1}, {2}): {3}", token.TokenKind.ToString(), token.Line, token.Col
                    , token.Data);
                if (token.TokenKind == TokenKind.EOF)
                    break;
            } while (true);

            goto Start;
        }
Exemple #2
0
 public TemplateParser(TemplateLexer lexer)
 {
     this.lexer = lexer;
     this.elements = new List<Element>();
 }