Documentation ¶
Index ¶
- func Parse(input string) (result ast.Ast, err error)
- func ParseKF(input string, errorListener *utils.ErrorListener, mode Mode) (result ast.Ast, err error)
- type KFVisitor
- func (v *KFVisitor) Visit(tree antlr.ParseTree) interface{}
- func (v *KFVisitor) VisitAction_attr_list(ctx *kfgrammar.Action_attr_listContext) interface{}
- func (v *KFVisitor) VisitAction_decl(ctx *kfgrammar.Action_declContext) interface{}
- func (v *KFVisitor) VisitAction_stmt(ctx *kfgrammar.Action_stmtContext) interface{}
- func (v *KFVisitor) VisitAction_stmt_list(ctx *kfgrammar.Action_stmt_listContext) interface{}
- func (v *KFVisitor) VisitAnnotation_decl(ctx *kfgrammar.Annotation_declContext) interface{}
- func (v *KFVisitor) VisitChildren(node antlr.RuleNode) interface{}
- func (c *KFVisitor) VisitColumn_constraint(ctx *kfgrammar.Column_constraintContext) interface{}
- func (v *KFVisitor) VisitColumn_def(ctx *kfgrammar.Column_defContext) interface{}
- func (v *KFVisitor) VisitColumn_def_list(ctx *kfgrammar.Column_def_listContext) interface{}
- func (v *KFVisitor) VisitColumn_name_list(ctx *kfgrammar.Column_name_listContext) interface{}
- func (v *KFVisitor) VisitExt_config_list(ctx *kfgrammar.Ext_config_listContext) interface{}
- func (v *KFVisitor) VisitExtension_directive(ctx *kfgrammar.Extension_directiveContext) interface{}
- func (v *KFVisitor) VisitForeign_key_action(ctx *kfgrammar.Foreign_key_actionContext) interface{}
- func (v *KFVisitor) VisitForeign_key_def(ctx *kfgrammar.Foreign_key_defContext) interface{}
- func (v *KFVisitor) VisitIndex_def(ctx *kfgrammar.Index_defContext) interface{}
- func (v *KFVisitor) VisitInit_decl(ctx *kfgrammar.Init_declContext) interface{}
- func (v *KFVisitor) VisitParam_list(ctx *kfgrammar.Param_listContext) interface{}
- func (v *KFVisitor) VisitSource_unit(ctx *kfgrammar.Source_unitContext) interface{}
- func (v *KFVisitor) VisitTable_decl(ctx *kfgrammar.Table_declContext) interface{}
- type Mode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KFVisitor ¶
type KFVisitor struct { kfgrammar.BaseKuneiformParserVisitor // contains filtered or unexported fields }
func NewKuneiformVisitor ¶
func (*KFVisitor) Visit ¶
func (v *KFVisitor) Visit(tree antlr.ParseTree) interface{}
Visit dispatch to the visit method of the ctx e.g. if the tree is a ParseContext, then dispatch call VisitParse. Overwrite is needed, refer to https://github.com/antlr/antlr4/pull/1841#issuecomment-576791512
func (*KFVisitor) VisitAction_attr_list ¶
func (v *KFVisitor) VisitAction_attr_list(ctx *kfgrammar.Action_attr_listContext) interface{}
func (*KFVisitor) VisitAction_decl ¶
func (v *KFVisitor) VisitAction_decl(ctx *kfgrammar.Action_declContext) interface{}
VisitAction_decl is called when parsing action declaration, return schema.Action
func (*KFVisitor) VisitAction_stmt ¶
func (v *KFVisitor) VisitAction_stmt(ctx *kfgrammar.Action_stmtContext) interface{}
VisitAction_stmt is called when parsing action statement, return string
func (*KFVisitor) VisitAction_stmt_list ¶
func (v *KFVisitor) VisitAction_stmt_list(ctx *kfgrammar.Action_stmt_listContext) interface{}
VisitAction_stmt_list is called when parsing action statement list, return []string
func (*KFVisitor) VisitAnnotation_decl ¶
func (v *KFVisitor) VisitAnnotation_decl(ctx *kfgrammar.Annotation_declContext) interface{}
VisitAnnotation_decl is called when parsing annotation declaration, return a string(without '@' sign)
func (*KFVisitor) VisitChildren ¶
func (v *KFVisitor) VisitChildren(node antlr.RuleNode) interface{}
VisitChildren visits the children of the specified node. Overwrite is needed, refer to https://github.com/antlr/antlr4/pull/1841#issuecomment-576791512 calling function need to convert the result to asts
func (*KFVisitor) VisitColumn_constraint ¶
func (c *KFVisitor) VisitColumn_constraint(ctx *kfgrammar.Column_constraintContext) interface{}
VisitColumn_constraint is called when parsing column constraint, return *schema.Attribute
func (*KFVisitor) VisitColumn_def ¶
func (v *KFVisitor) VisitColumn_def(ctx *kfgrammar.Column_defContext) interface{}
VisitColumn_def is called when parsing column definition, return *schema.Column
func (*KFVisitor) VisitColumn_def_list ¶
func (v *KFVisitor) VisitColumn_def_list(ctx *kfgrammar.Column_def_listContext) interface{}
VisitColumn_def_list is called when parsing column definition list, return []schema.Column
func (*KFVisitor) VisitColumn_name_list ¶
func (v *KFVisitor) VisitColumn_name_list(ctx *kfgrammar.Column_name_listContext) interface{}
VisitColumn_name_list is called when parsing column name list, return []string
func (*KFVisitor) VisitExt_config_list ¶
func (v *KFVisitor) VisitExt_config_list(ctx *kfgrammar.Ext_config_listContext) interface{}
func (*KFVisitor) VisitExtension_directive ¶
func (v *KFVisitor) VisitExtension_directive(ctx *kfgrammar.Extension_directiveContext) interface{}
func (*KFVisitor) VisitForeign_key_action ¶
func (v *KFVisitor) VisitForeign_key_action(ctx *kfgrammar.Foreign_key_actionContext) interface{}
func (*KFVisitor) VisitForeign_key_def ¶
func (v *KFVisitor) VisitForeign_key_def(ctx *kfgrammar.Foreign_key_defContext) interface{}
func (*KFVisitor) VisitIndex_def ¶
func (v *KFVisitor) VisitIndex_def(ctx *kfgrammar.Index_defContext) interface{}
VisitIndex_def is called when parsing index definition, return *schema.Index
func (*KFVisitor) VisitInit_decl ¶
func (v *KFVisitor) VisitInit_decl(ctx *kfgrammar.Init_declContext) interface{}
VisitInit_decl is called when parsing init declaration, return schema.Action
func (*KFVisitor) VisitParam_list ¶
func (v *KFVisitor) VisitParam_list(ctx *kfgrammar.Param_listContext) interface{}
VisitParam_list is called when parsing action parameter list, return []string
func (*KFVisitor) VisitSource_unit ¶
func (v *KFVisitor) VisitSource_unit(ctx *kfgrammar.Source_unitContext) interface{}
VisitSource_unit is called when start parsing, return *schema.Schema
func (*KFVisitor) VisitTable_decl ¶
func (v *KFVisitor) VisitTable_decl(ctx *kfgrammar.Table_declContext) interface{}
VisitTable_decl is called when parsing table declaration, return *schema.Table