Documentation ¶
Overview ¶
Package parse provides methods to parse datalog programs and parts thereof.
Index ¶
- func Atom(s string) (ast.Atom, error)
- func BaseTerm(s string) (ast.BaseTerm, error)
- func Clause(s string) (ast.Clause, error)
- func LiteralOrFormula(s string) (ast.Term, error)
- func PredicateName(s string) (string, error)
- func Term(s string) (ast.Term, error)
- type Error
- type Parser
- func (p *Parser) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ...)
- func (p *Parser) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, ...)
- func (p *Parser) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, ...)
- func (p *Parser) SyntaxError(recognizer antlr.Recognizer, offendingSymbol any, line, column int, msg string, ...)
- func (p *Parser) Visit(tree antlr.ParseTree) any
- func (p Parser) VisitAppl(ctx *gen.ApplContext) any
- func (p Parser) VisitAtom(ctx *gen.AtomContext) any
- func (p Parser) VisitAtoms(ctx *gen.AtomsContext) any
- func (p Parser) VisitBStr(ctx *gen.BStrContext) any
- func (p Parser) VisitBoundsBlock(ctx *gen.BoundsBlockContext) any
- func (p Parser) VisitClause(ctx *gen.ClauseContext) any
- func (p Parser) VisitClauseBody(ctx *gen.ClauseBodyContext) any
- func (p Parser) VisitConst(ctx *gen.ConstContext) any
- func (p Parser) VisitConstraintsBlock(ctx *gen.ConstraintsBlockContext) any
- func (p Parser) VisitDecl(ctx *gen.DeclContext) any
- func (p Parser) VisitDescrBlock(ctx *gen.DescrBlockContext) any
- func (p Parser) VisitFloat(ctx *gen.FloatContext) any
- func (p Parser) VisitLetStmt(ctx *gen.LetStmtContext) any
- func (p Parser) VisitList(ctx *gen.ListContext) any
- func (p Parser) VisitLiteralOrFml(ctx *gen.LiteralOrFmlContext) any
- func (p Parser) VisitMap(ctx *gen.MapContext) any
- func (p Parser) VisitNum(ctx *gen.NumContext) any
- func (p Parser) VisitPackageDecl(ctx *gen.PackageDeclContext) any
- func (p Parser) VisitProgram(ctx *gen.ProgramContext) any
- func (p Parser) VisitStart(ctx *gen.StartContext) any
- func (p Parser) VisitStr(ctx *gen.StrContext) any
- func (p Parser) VisitStruct(ctx *gen.StructContext) any
- func (p Parser) VisitTransform(ctx *gen.TransformContext) any
- func (p Parser) VisitUseDecl(ctx *gen.UseDeclContext) any
- func (p Parser) VisitVar(ctx *gen.VarContext) any
- type SourceUnit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LiteralOrFormula ¶
LiteralOrFormula parses a single Term, an equality or inequality from a given string.
func PredicateName ¶
PredicateName parses a predicate name.
Types ¶
type Error ¶
type Error struct { Message string Line int // 1-based line number within source. Column int // 0-based line number within source. }
Error represents a parser error messages, without location.
type Parser ¶
type Parser struct { gen.BaseMangleVisitor // contains filtered or unexported fields }
Parser represents an object that can be used for parsing.
func (*Parser) ReportAmbiguity ¶
func (p *Parser) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ambigAlts *antlr.BitSet, configs *antlr.ATNConfigSet)
ReportAmbiguity implements error listener interface.
func (*Parser) ReportAttemptingFullContext ¶
func (p *Parser) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs *antlr.ATNConfigSet)
ReportAttemptingFullContext implements error listener interface.
func (*Parser) ReportContextSensitivity ¶
func (p *Parser) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs *antlr.ATNConfigSet)
ReportContextSensitivity implements error listener interface.
func (*Parser) SyntaxError ¶
func (p *Parser) SyntaxError(recognizer antlr.Recognizer, offendingSymbol any, line, column int, msg string, e antlr.RecognitionException)
SyntaxError is called by ANTLR generated code when a syntax error is encountered.
func (Parser) VisitAppl ¶
func (p Parser) VisitAppl(ctx *gen.ApplContext) any
VisitAppl visits a parse tree produced by MangleParser#Appl.
func (Parser) VisitAtom ¶
func (p Parser) VisitAtom(ctx *gen.AtomContext) any
VisitAtom visits a parse tree produced by MangleParser#atoms.
func (Parser) VisitAtoms ¶
func (p Parser) VisitAtoms(ctx *gen.AtomsContext) any
VisitAtoms visits a parse tree produced by MangleParser#atoms.
func (Parser) VisitBStr ¶ added in v0.2.0
func (p Parser) VisitBStr(ctx *gen.BStrContext) any
VisitBStr visits a parse tree produced by MangleParser#BStr.
func (Parser) VisitBoundsBlock ¶
func (p Parser) VisitBoundsBlock(ctx *gen.BoundsBlockContext) any
VisitBoundsBlock visits a parse tree produced by MangleParser#boundsBlock.
func (Parser) VisitClause ¶
func (p Parser) VisitClause(ctx *gen.ClauseContext) any
VisitClause visits a parse tree produced by MangleParser#clause.
func (Parser) VisitClauseBody ¶
func (p Parser) VisitClauseBody(ctx *gen.ClauseBodyContext) any
VisitClauseBody visits a parse tree produced by MangleParser#clauseBody.
func (Parser) VisitConst ¶
func (p Parser) VisitConst(ctx *gen.ConstContext) any
VisitConst visits a parse tree produced by MangleParser#Const.
func (Parser) VisitConstraintsBlock ¶
func (p Parser) VisitConstraintsBlock(ctx *gen.ConstraintsBlockContext) any
VisitConstraintsBlock visits a parse tree produced by MangleParser#constraintsBlock.
func (Parser) VisitDecl ¶
func (p Parser) VisitDecl(ctx *gen.DeclContext) any
VisitDecl visits a parse tree produced by MangleParser#decl.
func (Parser) VisitDescrBlock ¶
func (p Parser) VisitDescrBlock(ctx *gen.DescrBlockContext) any
VisitDescrBlock visits a parse tree produced by MangleParser#descrBlock.
func (Parser) VisitFloat ¶
func (p Parser) VisitFloat(ctx *gen.FloatContext) any
VisitFloat visits a parse tree produced by MangleParser#Float.
func (Parser) VisitLetStmt ¶
func (p Parser) VisitLetStmt(ctx *gen.LetStmtContext) any
VisitLetStmt visits a parse tree produced by MangleParser#letStmt.
func (Parser) VisitList ¶
func (p Parser) VisitList(ctx *gen.ListContext) any
VisitList visits a parse tree produced by MangleParser#List.
func (Parser) VisitLiteralOrFml ¶
func (p Parser) VisitLiteralOrFml(ctx *gen.LiteralOrFmlContext) any
VisitLiteralOrFml visits a parse tree produced by literalOrFml
func (Parser) VisitMap ¶
func (p Parser) VisitMap(ctx *gen.MapContext) any
VisitMap visits a parse tree produced by MangleParser#Map.
func (Parser) VisitNum ¶
func (p Parser) VisitNum(ctx *gen.NumContext) any
VisitNum visits a parse tree produced by MangleParser#Num.
func (Parser) VisitPackageDecl ¶
func (p Parser) VisitPackageDecl(ctx *gen.PackageDeclContext) any
VisitPackageDecl visits a parse tree produced by MangleParser#packageDecl.
func (Parser) VisitProgram ¶
func (p Parser) VisitProgram(ctx *gen.ProgramContext) any
VisitProgram visits a parse tree produced by MangleParser#program.
func (Parser) VisitStart ¶
func (p Parser) VisitStart(ctx *gen.StartContext) any
VisitStart visits a parse tree produced by MangleParser#start.
func (Parser) VisitStr ¶
func (p Parser) VisitStr(ctx *gen.StrContext) any
VisitStr visits a parse tree produced by MangleParser#Str.
func (Parser) VisitStruct ¶
func (p Parser) VisitStruct(ctx *gen.StructContext) any
VisitStruct visits a parse tree produced by MangleParser#Struct.
func (Parser) VisitTransform ¶
func (p Parser) VisitTransform(ctx *gen.TransformContext) any
VisitTransform visits a parse tree produced by MangleParser#transform.
func (Parser) VisitUseDecl ¶
func (p Parser) VisitUseDecl(ctx *gen.UseDeclContext) any
VisitUseDecl visits a parse tree produced by MangleParser#useDecl.