예제 #1
0
        public override void ExitSymbol([NotNull] ClojureObrParser.SymbolContext context)
        {
            //
            //Console.WriteLine("Вышел из символа");
            string symbText = context.GetText();
            Symbol symb     = null;

            if (ExprSymTypes.Get(context.Parent) != SymType.Key &&
                ExprSymTypes.Get(context.Parent) != SymType.Fun)
            {
                symb = currentSymbolTable.Symbols[symbText];
                ExprSymTypes.Put(context, SymType.Sym);
                ExprSyms.Put(context, symb);
            }
            //

            SymNode node = new SymNode(symbText, symb?.Value);

            TypedNodes.Put(context, node);
        }
예제 #2
0
 public DefNode(SymNode symNode, ExprNode expr)
 {
     type    = NodeType.Def;
     sym     = symNode;
     defExpr = expr;
 }