コード例 #1
0
        public override void Visit(ExtractMinQueryNode node)
        {
            _symbolTable.SetCurrentNode(node);
            checkCollectionFollowsCollection(node.Variable);
            AllType collectionNameType = _symbolTable.RetrieveSymbol(node.Variable, out bool isCollectionInQuery, false) ?? AllType.UNKNOWNTYPE;

            /*if (_symbolTable.IsClass(collectionNameType)) {
             *      _symbolTable.CollectionOfClasses();
             *      return;
             * }*/
            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);
            }
        }
コード例 #2
0
 public override void Visit(ExtractMinQueryNode 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);
     }
 }
コード例 #3
0
 public override void Visit(ExtractMinQueryNode node)
 {
     Debug.Print("ExtractMinQueryNode");
     ProgramCode.Append("EXTRACTMIN ");
     if (node.Attribute != null)
     {
         ProgramCode.Append($"{node.Attribute} ");
     }
     ProgramCode.Append($"FROM {node.Variable}");
     if (node.WhereCondition != null)
     {
         node.WhereCondition.Accept(this);
     }
     ProgramCode.Append(");\n");
 }
コード例 #4
0
        public override AbstractNode VisitExtractMinOP([NotNull] GiraphParser.ExtractMinOPContext context)
        {
            ExtractMinQueryNode ExtractQuery = new ExtractMinQueryNode(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);
        }
コード例 #5
0
 public abstract void Visit(ExtractMinQueryNode node);