Ejemplo n.º 1
0
 IASTElement IParsable.Parse(Lexer lexer, IASTElement parent)
 {
     while (!lexer.InspectEOF())
     {
         lexer.GobbleWhitespace();
         // find a valid command
         IASTElement cmd = new ASTCommand();
         Children.Add(cmd.Parse(lexer, this));
         lexer.GobbleWhitespace();
     }
     return(this);
 }
Ejemplo n.º 2
0
        public string GetCodeForFileWrite(ASTCommand cmd)
        {
            var type     = cmd.Command.ToLower();
            var ops      = ((ASTCompoundExpression)cmd.Operand).Expressions;
            var fileName = GetCodeForExpression(ops[0]);
            var contents = GetCodeForExpression(ops[1]);

            return(Target.GetComplexSnippet("commands", type, new Dictionary <string, string>()
            {
                { "fileName", fileName },
                { "contents", contents }
            }));
        }