Example #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);
            }
        }
Example #2
0
        public CodeGen(ASTNodeBase astTree, GlobalSymbolTable globalSymbolTable, CodeWriter codeStream)
        {
            _astTree           = astTree;
            _globalSymbolTable = globalSymbolTable;
            _writer            = codeStream;

            _sizeCalculator = new SizeCalculator(_astTree, _globalSymbolTable);
        }
Example #3
0
 public SizeCalculator(ASTNodeBase astTree, GlobalSymbolTable globalSymbolTable)
 {
     _astTree           = astTree;
     _globalSymbolTable = globalSymbolTable;
 }
 public Sequence(ASTNodeBase leftNode, Sequence sequence)
     : base(leftNode, sequence)
 {
 }
 protected ASTNodeBase(ASTNodeBase leftNode, ASTNodeBase rightNode)
 {
     _leftNode = leftNode;
     _rightNode = rightNode;
 }
Example #6
0
        private void PrintDOTParentChild(ASTNodeBase node)
        {
            var parent = node.ParentNode;

            _stream.WriteLine($"{parent.ID} -> {node.ID}");
        }
Example #7
0
        private void PrintDOTIDLabel(ASTNodeBase node, string data)
        {
            var stringifiedType = TypePrintUtils.StringifyType(node.GetType());

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