public override object VisitTableElement([NotNull] MiniSQLParser.TableElementContext context) { TableElement element = new TableElement(); if (context.columnDefinition() != null) { element.Type = TableElementType.AttributeDeclaration; element.AttributeDeclaration = (AttributeDeclaration)Visit(context.columnDefinition()); } else { element.Type = TableElementType.PrimaryKey; element.PrimaryKey = (string)Visit(context.tableConstraintDef()); } return(element); }
/// <summary> /// Exit a parse tree produced by <see cref="MiniSQLParser.tableElement"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitTableElement([NotNull] MiniSQLParser.TableElementContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="MiniSQLParser.tableElement"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitTableElement([NotNull] MiniSQLParser.TableElementContext context) { return(VisitChildren(context)); }