コード例 #1
0
        public void Visit(FuncCallParamsNode n)
        {
            var children = n.GetChildren();

            ITable      statementsSymTable;
            ASTNodeBase currentNode = n;

            while (!(currentNode is StatementsNode))
            {
                currentNode = currentNode.ParentNode;
                if (currentNode == null)
                {
                    throw new Exception("StatementsNode is somehow not a distant parent of this node...");
                }
            }

            statementsSymTable = currentNode.SymTable;

            foreach (var node in children)
            {
                node.SymTable = statementsSymTable;
                node.Accept(this);
            }

            foreach (var child in children)
            {
                n.ParamsTypes.Add(child.ExprType);
            }
        }
コード例 #2
0
        public CodeGen(ASTNodeBase astTree, GlobalSymbolTable globalSymbolTable, CodeWriter codeStream)
        {
            _astTree           = astTree;
            _globalSymbolTable = globalSymbolTable;
            _writer            = codeStream;

            _sizeCalculator = new SizeCalculator(_astTree, _globalSymbolTable);
        }
コード例 #3
0
 public SizeCalculator(ASTNodeBase astTree, GlobalSymbolTable globalSymbolTable)
 {
     _astTree           = astTree;
     _globalSymbolTable = globalSymbolTable;
 }
コード例 #4
0
 public Sequence(ASTNodeBase leftNode, Sequence sequence)
     : base(leftNode, sequence)
 {
 }
コード例 #5
0
 protected ASTNodeBase(ASTNodeBase leftNode, ASTNodeBase rightNode)
 {
     _leftNode = leftNode;
     _rightNode = rightNode;
 }
コード例 #6
0
ファイル: DOTPrinterVisitor.cs プロジェクト: sebdesl/COMP442
        private void PrintDOTParentChild(ASTNodeBase node)
        {
            var parent = node.ParentNode;

            _stream.WriteLine($"{parent.ID} -> {node.ID}");
        }
コード例 #7
0
ファイル: DOTPrinterVisitor.cs プロジェクト: sebdesl/COMP442
        private void PrintDOTIDLabel(ASTNodeBase node, string data)
        {
            var stringifiedType = TypePrintUtils.StringifyType(node.GetType());

            _stream.WriteLine($"{node.ID}[label=\"{node.ID}:{stringifiedType}\\n{data}\"]");
        }
コード例 #8
0
 internal CAMLWhere(ASTNodeBase leftNode)
     : base(leftNode)
 {
 }
コード例 #9
0
 //internal Where(ASTNodeBase leftNode, ASTNodeBase rightNode)
 //        : base(leftNode, rightNode)
 //{
 //}
 internal Where(ASTNodeBase leftNode)
     : base(leftNode, null)
 {
 }