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); } }
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); } }
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"); }
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); }
public abstract void Visit(ExtractMinQueryNode node);