public override void Visit(ExtractMaxQueryNode node)
 {
     SymbolTable.SetCurrentNode(node);
     CheckDeclared(node.Variable);
     if (node.WhereCondition != null)
     {
         var type = SymbolTable.RetrieveSymbol(node.Variable);
         (node.WhereCondition as WhereNode).AttributeClass = type ?? default(AllType);
         node.WhereCondition.Accept(this);
     }
 }
 public override void Visit(ExtractMaxQueryNode node)
 {
     Debug.Print("ExtractMaxQueryNode");
     ProgramCode.Append("EXTRACTMAX ");
     if (node.Attribute != null)
     {
         ProgramCode.Append($"{node.Attribute} ");
     }
     ProgramCode.Append($"FROM {node.Variable}");
     if (node.WhereCondition != null)
     {
         node.WhereCondition.Accept(this);
     }
     ProgramCode.Append(");\n");
 }
Beispiel #3
0
        public override AbstractNode VisitExtractMaxOP([NotNull] GiraphParser.ExtractMaxOPContext context)
        {
            ExtractMaxQueryNode ExtractQuery = new ExtractMaxQueryNode(context.Start.Line, context.Start.Column);

            ExtractQuery.Variable = context.variable().GetText();
            ExtractQuery.Name     = ExtractQuery.Variable;
            if (context.attribute() != null)
            {
                ExtractQuery.Attribute = context.attribute().GetText();
            }
            if (context.where () != null)
            {
                ExtractQuery.WhereCondition = Visit(context.where ());
            }
            return(ExtractQuery);
        }
Beispiel #4
0
        public override void Visit(ExtractMaxQueryNode node)
        {
            _symbolTable.SetCurrentNode(node);
            checkCollectionFollowsCollection(node.Variable);
            AllType?collectionNameType = _symbolTable.RetrieveSymbol(node.Variable, out bool isCollectionInQuery, false);

            if (isCollectionInQuery)
            {
                node.Type = collectionNameType.ToString().ToLower();
                if (!_symbolTable.IsClass(node.Type_enum) && node.Attribute != null && node.Attribute != "")
                {
                    _symbolTable.AttributeUsedOnNonClass();
                }
            }
            else
            {
                _symbolTable.NotCollection(node.Variable);
            }
            if (node.WhereCondition != null)
            {
                node.WhereCondition.Accept(this);
            }
        }
 public abstract void Visit(ExtractMaxQueryNode node);