示例#1
0
        // Call this method to begin the semantic checking process
        public void CheckSemantics(AbstractNode node)
        {
            if (node == null)
            {
                return;
            }
            TopDclVisitor tdv = new TopDclVisitor();

            // Do Top-Declaration pass
            node.Accept(tdv);
            ///More here
        }
示例#2
0
        public void VisitNode(PrimitiveType node)
        {
            // Get this symbol from the symbol table
            AbstractAttr proposedType = TopDclVisitor.currentSymbolTable.lookup(Utilities.FilterOutKeywords(node.Name));

            if (proposedType == null)
            {
                TopDclVisitor.Error(String.Format("Warning! Type {0} does not exist in symbol table!", node.Name));
                proposedType          = new Attributes("Error");
                proposedType.typeInfo = new ErrorTypeDescriptor();
            }
            node.attrRef = proposedType;
        }
示例#3
0
        internal static void DclVisitAllChildren(AbstractNode node, TopDclVisitor d)
        {
            AbstractNode an;

            an = node.Child;
            while (an != null)
            {
                an.Accept(d);
                if (an.Sib != an)
                {
                    an = an.Sib;
                }
            }
        }