Esempio n. 1
0
        public static StatementBlock Parse(string s)
        {
            var statements = new List<LuaStatement>();
            var reader = new StringReader(s);
            var rootScope = new Scope();
            var context = new ParserContext(rootScope);
            INextAwareEnumerator<Token> enumerator = Tokenizer.Parse(reader);

            while (enumerator.HasNext && enumerator.MoveNext())
            {
                var statement = ReadStatement(enumerator, context);
                statements.Add(statement);
            }

            return new StatementBlock(statements);
        }
Esempio n. 2
0
 public IScope AcquireScope()
 {
     var scope = new Scope(CurrentScope);
     CurrentScope = scope;
     return scope;
 }