Example #1
0
        private Dict Visit(DictAST dictAST)
        {
            Dict dictionary = new Dict();

            foreach (KeyValuePairAST keyValuePairAST in dictAST.Parameters)
            {
                KeyValuePair <string, object> keyValuePair = Visit(keyValuePairAST);
                dictionary.Add(keyValuePair.Key, keyValuePair.Value);
            }
            return(dictionary);
        }
Example #2
0
        private ConfigureAST Block()
        {
            AST declareAST = Declare();

            if (currentToken.Type == TokenType.LBRC)
            {
                DictAST dictAST = Configure();
                return(new ConfigureAST(declareAST, dictAST));
            }
            else
            {
                return(new ConfigureAST(declareAST, new DictAST(new List <KeyValuePairAST>())));
            }
        }