Documentation ¶
Index ¶
- func TokenError(t antlr.Token) func(format string, args ...interface{}) error
- type Action
- type ActionDispatcher
- type AnonymousOption
- type AtEnd
- type CheckFixedWithoutPass
- type ErrorListener
- func (el *ErrorListener) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ...)
- func (el *ErrorListener) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, ...)
- func (el *ErrorListener) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, ...)
- func (el *ErrorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, ...)
- type ErrorOnMismatch
- type Field
- type FieldMeta
- type MayBeStartChar
- type MayBeStartString
- type Optional
- type OptionalSilent
- type PassAfter
- type PassAfterOrIgnore
- type PassBefore
- type PassBeforeOrIgnore
- type PassFixed
- type PassHeadingCharacters
- type RestLengthCheck
- type Rule
- type StartChar
- type StartCharWithoutPass
- type StartString
- type StartStringWithoutPass
- type Take
- type TakeIncluding
- type TakeRest
- type TakeUntilIncludingOrRest
- type TakeUntilOrRest
- type Target
- type TargetEnum
- type TypeRegistration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action interface { fmt.Stringer Accept(d ActionDispatcher) error // contains filtered or unexported methods }
Action абстракция действия
type ActionDispatcher ¶
type ActionDispatcher interface { DispatchAnonymousOption(a *AnonymousOption) error DispatchAtEnd(a AtEnd) error DispatchRestLengthCheck(a RestLengthCheck) error DispatchErrorMismatch(a ErrorOnMismatch) error DispatchMayBeStartChar(a *MayBeStartChar) error DispatchMayBeStartString(a *MayBeStartString) error DispatchOptional(a *Optional) error DispatchOptionalSilent(a *OptionalSilent) error DispatchPassHeadingCharacters(a PassHeadingCharacters) error DispatchPassFirst(a PassFixed) error DispatchPassAfter(a *PassAfter) error DispatchPassAfterOrIgnore(a *PassAfterOrIgnore) error DispatchPassBefore(a *PassBefore) error DispatchPassBeforeOrIgnore(a *PassBeforeOrIgnore) error DispatchStartChar(a *StartChar) error DispatchStartCharWithoutPass(a *StartCharWithoutPass) error DispatchStartString(a *StartString) error DispatchStartStringWithoutPass(a *StartStringWithoutPass) error DispatchTake(a *Take) error DispatchTakeIncluding(a *TakeIncluding) error DispatchTakeRest(a *TakeRest) error DispatchTakeUntilOrRest(a *TakeUntilOrRest) error DispatchTakeUntilIncludingOrRest(a *TakeUntilIncludingOrRest) error DispatchRule(a *Rule) error DispatchTypeRegistration(a TypeRegistration) error DispatchCheckFixedWithoutPass(a *CheckFixedWithoutPass) error }
ActionDispatcher is to be used by various actions to generate their arbitrary code
type AnonymousOption ¶
type AnonymousOption struct { Name string Comment []string Actions []Action StartToken antlr.Token // contains filtered or unexported fields }
AnonymousOption ...
func (*AnonymousOption) Accept ¶
func (a *AnonymousOption) Accept(d ActionDispatcher) error
Accept ...
func (*AnonymousOption) String ¶
func (a *AnonymousOption) String() string
type AtEnd ¶
type AtEnd struct {
// contains filtered or unexported fields
}
AtEnd ...
func (AtEnd) Accept ¶
func (a AtEnd) Accept(d ActionDispatcher) error
type CheckFixedWithoutPass ¶ added in v0.1.1
type CheckFixedWithoutPass struct { Limit *Target // contains filtered or unexported fields }
CheckFixedWithoutPass ...
func CheckFixedTargetWithoutPass ¶ added in v0.1.1
func CheckFixedTargetWithoutPass() *CheckFixedWithoutPass
CheckFixedTargetWithoutPass ...
func (*CheckFixedWithoutPass) Accept ¶ added in v0.1.1
func (pu *CheckFixedWithoutPass) Accept(d ActionDispatcher) error
func (*CheckFixedWithoutPass) String ¶ added in v0.1.1
func (pu *CheckFixedWithoutPass) String() string
type ErrorListener ¶
ErrorListener representation of evil
func (*ErrorListener) ReportAmbiguity ¶
func (*ErrorListener) ReportAttemptingFullContext ¶
func (el *ErrorListener) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs antlr.ATNConfigSet)
func (*ErrorListener) ReportContextSensitivity ¶
func (el *ErrorListener) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs antlr.ATNConfigSet)
func (*ErrorListener) SyntaxError ¶
func (el *ErrorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException)
type ErrorOnMismatch ¶
type ErrorOnMismatch struct {
// contains filtered or unexported fields
}
ErrorOnMismatch ...
func (ErrorOnMismatch) Accept ¶
func (e ErrorOnMismatch) Accept(d ActionDispatcher) error
func (ErrorOnMismatch) String ¶
func (ErrorOnMismatch) String() string
type Field ¶
type Field struct { Name string Type string Meta FieldMeta Comment []string NameToken antlr.Token TypeToken antlr.Token }
Field ...
type MayBeStartChar ¶
type MayBeStartChar struct { Value string // contains filtered or unexported fields }
MayBeStartChar ...
func MayBeStartsWithChar ¶
func MayBeStartsWithChar(value antlr.Token) *MayBeStartChar
MayBeStartsWithChar ...
func (*MayBeStartChar) Accept ¶
func (m *MayBeStartChar) Accept(d ActionDispatcher) error
func (*MayBeStartChar) String ¶
func (m *MayBeStartChar) String() string
type MayBeStartString ¶
type MayBeStartString struct { Value string // contains filtered or unexported fields }
MayBeStartString ...
func MayBeStartsWithString ¶
func MayBeStartsWithString(value antlr.Token) *MayBeStartString
MayBeStartsWithString ...
func (*MayBeStartString) Accept ¶
func (m *MayBeStartString) Accept(d ActionDispatcher) error
func (*MayBeStartString) String ¶
func (m *MayBeStartString) String() string
type Optional ¶
type Optional struct { Name string Comment []string Actions []Action NameToken antlr.Token // contains filtered or unexported fields }
Optional ...
func (*Optional) Accept ¶
func (o *Optional) Accept(d ActionDispatcher) error
type OptionalSilent ¶ added in v0.1.1
type OptionalSilent struct { Name string Comment []string Actions []Action NameToken antlr.Token // contains filtered or unexported fields }
OptionalSilent ...
func OptionSilent ¶ added in v0.1.1
func OptionSilent(comment []string, opt antlr.Token) *OptionalSilent
OptionSilent ...
func (*OptionalSilent) Accept ¶ added in v0.1.1
func (o *OptionalSilent) Accept(d ActionDispatcher) error
func (*OptionalSilent) Append ¶ added in v0.1.1
func (o *OptionalSilent) Append(i Action)
Append ...
func (*OptionalSilent) String ¶ added in v0.1.1
func (o *OptionalSilent) String() string
type PassAfter ¶
type PassAfter struct { Limit *Target // contains filtered or unexported fields }
PassAfter ...
func (*PassAfter) Accept ¶
func (pu *PassAfter) Accept(d ActionDispatcher) error
type PassAfterOrIgnore ¶
type PassAfterOrIgnore struct { Limit *Target // contains filtered or unexported fields }
PassAfterOrIgnore ...
func PassAfterTargetOrIgnore ¶
func PassAfterTargetOrIgnore() *PassAfterOrIgnore
PassAfterTargetOrIgnore ...
func (*PassAfterOrIgnore) Accept ¶
func (p *PassAfterOrIgnore) Accept(d ActionDispatcher) error
func (*PassAfterOrIgnore) String ¶
func (p *PassAfterOrIgnore) String() string
type PassBefore ¶
type PassBefore struct { Limit *Target // contains filtered or unexported fields }
PassBefore ...
func (*PassBefore) Accept ¶
func (pu *PassBefore) Accept(d ActionDispatcher) error
func (*PassBefore) String ¶
func (pu *PassBefore) String() string
type PassBeforeOrIgnore ¶
type PassBeforeOrIgnore struct { Limit *Target // contains filtered or unexported fields }
PassBeforeOrIgnore ...
func PassBeforeTargetOrIgnore ¶
func PassBeforeTargetOrIgnore() *PassBeforeOrIgnore
PassBeforeTargetOrIgnore ...
func (*PassBeforeOrIgnore) Accept ¶
func (p *PassBeforeOrIgnore) Accept(d ActionDispatcher) error
func (*PassBeforeOrIgnore) String ¶
func (p *PassBeforeOrIgnore) String() string
type PassFixed ¶
type PassFixed int
PassFixed ...
func (PassFixed) Accept ¶
func (pf PassFixed) Accept(d ActionDispatcher) error
type PassHeadingCharacters ¶
type PassHeadingCharacters string
func (PassHeadingCharacters) Accept ¶
func (a PassHeadingCharacters) Accept(d ActionDispatcher) error
func (PassHeadingCharacters) String ¶
func (a PassHeadingCharacters) String() string
type RestLengthCheck ¶
type RestLengthCheck struct { Operator string Length int // contains filtered or unexported fields }
func RestCheck ¶
func RestCheck(operator string, length int) RestLengthCheck
func (RestLengthCheck) Accept ¶
func (a RestLengthCheck) Accept(d ActionDispatcher) error
func (RestLengthCheck) String ¶
func (a RestLengthCheck) String() string
type Rule ¶
type Rule struct { Name string Comment []string Actions []Action NameToken antlr.Token // contains filtered or unexported fields }
Rule is action as well
func (*Rule) Accept ¶
func (r *Rule) Accept(d ActionDispatcher) error
type StartChar ¶
type StartChar struct { Value string // contains filtered or unexported fields }
StartChar ...
func (*StartChar) Accept ¶
func (sc *StartChar) Accept(d ActionDispatcher) error
type StartCharWithoutPass ¶
type StartCharWithoutPass struct { Value string // contains filtered or unexported fields }
StartCharWithoutPass ...
func StartsWithCharWithoutPass ¶
func StartsWithCharWithoutPass(target antlr.Token) *StartCharWithoutPass
StartsWithCharWithoutPass ...
func (*StartCharWithoutPass) Accept ¶
func (sc *StartCharWithoutPass) Accept(d ActionDispatcher) error
func (*StartCharWithoutPass) String ¶
func (sc *StartCharWithoutPass) String() string
type StartString ¶
type StartString struct { Value string // contains filtered or unexported fields }
StartString ...
func StartsWithString ¶
func StartsWithString(target antlr.Token) *StartString
StartsWithString constructor
func (*StartString) Accept ¶
func (ss *StartString) Accept(d ActionDispatcher) error
func (*StartString) String ¶
func (ss *StartString) String() string
type StartStringWithoutPass ¶
type StartStringWithoutPass struct { Value string // contains filtered or unexported fields }
StartStringWithoutPass ...
func StartsWithStringWithoutPass ¶
func StartsWithStringWithoutPass(target antlr.Token) *StartStringWithoutPass
StartsWithStringWithoutPass constructor
func (*StartStringWithoutPass) Accept ¶
func (ss *StartStringWithoutPass) Accept(d ActionDispatcher) error
func (*StartStringWithoutPass) String ¶
func (ss *StartStringWithoutPass) String() string
type Take ¶
Take ...
func TakeUntilTarget ¶
TakeUntilTarget ...
func (*Take) Accept ¶
func (t *Take) Accept(d ActionDispatcher) error
type TakeIncluding ¶
TakeIncluding ...
func TakeUntilTargetIncluding ¶
func TakeUntilTargetIncluding(comment []string, field, fieldType antlr.Token) *TakeIncluding
TakeUntilTargetIncluding ...
func (*TakeIncluding) String ¶
func (t *TakeIncluding) String() string
type TakeRest ¶
type TakeRest struct { Field Field // contains filtered or unexported fields }
TakeRest ...
func TakeTheRest ¶
TakeTheRest ...
func (*TakeRest) Accept ¶
func (tr *TakeRest) Accept(d ActionDispatcher) error
type TakeUntilIncludingOrRest ¶
type TakeUntilIncludingOrRest struct { Field Field Limit *Target // contains filtered or unexported fields }
TakeUntilOrRest ...
func TakeUntilTargetIncludingOrRest ¶
func TakeUntilTargetIncludingOrRest(comment []string, field antlr.Token, fieldType antlr.Token) *TakeUntilIncludingOrRest
TakeUntilTargetIncludingOrRest ...
func (*TakeUntilIncludingOrRest) Accept ¶
func (t *TakeUntilIncludingOrRest) Accept(d ActionDispatcher) error
Accept ...
func (*TakeUntilIncludingOrRest) String ¶
func (t *TakeUntilIncludingOrRest) String() string
type TakeUntilOrRest ¶
TakeUntilOrRest ...
func TakeUntilTargetOrRest ¶
func TakeUntilTargetOrRest(comment []string, field antlr.Token, fieldType antlr.Token) *TakeUntilOrRest
TakeUntilTargetOrRest ...
func (*TakeUntilOrRest) Accept ¶
func (t *TakeUntilOrRest) Accept(d ActionDispatcher) error
func (*TakeUntilOrRest) String ¶
func (t *TakeUntilOrRest) String() string
type Target ¶
type Target struct { Type TargetEnum Value string Lower int Upper int Close bool }
Target ...
type TargetEnum ¶
type TargetEnum int
TargetEnum ...
const ( String TargetEnum = iota Char )
func (TargetEnum) String ¶
func (i TargetEnum) String() string
type TypeRegistration ¶ added in v0.1.0
type TypeRegistration struct {
// contains filtered or unexported fields
}
func NewTypeRegistration ¶ added in v0.1.0
func NewTypeRegistration(tr map[string]types.TypeRegistration) TypeRegistration
func (TypeRegistration) Accept ¶ added in v0.1.0
func (t TypeRegistration) Accept(d ActionDispatcher) error
func (TypeRegistration) String ¶ added in v0.1.0
func (t TypeRegistration) String() string
func (TypeRegistration) Types ¶ added in v0.1.0
func (t TypeRegistration) Types() map[string]types.TypeRegistration
Source Files ¶
- action.go
- action_anonymous_option.go
- action_at_end.go
- action_check_fixed_without_pass.go
- action_error_on_mismatch.go
- action_may_be_start_char.go
- action_may_be_start_string.go
- action_optional.go
- action_optional_silent.go
- action_pass_after.go
- action_pass_after_or_ignore.go
- action_pass_before.go
- action_pass_before_or_ignore.go
- action_pass_first.go
- action_pass_heading_characters.go
- action_rest_length_check.go
- action_start_char.go
- action_start_char_without_pass.go
- action_start_string.go
- action_start_string_without_pass.go
- action_take.go
- action_take_including.go
- action_take_rest.go
- action_take_until_including_or_rest.go
- action_take_until_or_rest.go
- action_type_registration.go
- action_z_dispatcher.go
- error.go
- field.go
- rule.go
- target-enums.go
- targetenum_string.go
- targets.go
- util.go