示例#1
0
        public override void Visit(SelectAllQueryNode node)
        {
            _symbolTable.SetCurrentNode(node);
            checkCollectionFollowsCollection(node.Variable);
            AllType?collectionNameType = _symbolTable.RetrieveSymbol(node.Variable, out bool isCollectionInQuery, false);
            bool    fromIsColl         = isCollectionInQuery;

            if (fromIsColl)
            {
                if (node.Parent is DeclarationNode dclNode)
                {
                    node.Type = collectionNameType.ToString();
                    node.Name = node.Variable;
                }
                else if (node.Parent is ExpressionNode expNode)
                {
                    // extractmin 'length' from selectall from asdf where () where ()
                    node.Type = collectionNameType.ToString();
                    //expNode.QueryName = node.Variable;
                    expNode.OverAllType = collectionNameType;
                    expNode.Name        = node.Variable;
                }
            }
            else
            {
                _symbolTable.FromVarIsNotCollError(node.Variable);
            }
            if (node.WhereCondition != null)
            {
                node.WhereCondition.Accept(this);
            }
        }