parser

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LCUR = "{"
	RCUR = "}"
)

Variables

View Source
var (
	RequiredError          error = errors.New("expecting 'required' or 'optional'")
	InvalidFieldTypeError  error = errors.New("expecting a valid field type")
	InvalidFieldIndexError error = errors.New("expecting a valid int16 field index")

	InvalidStructError           error = errors.New("expecting a valid struct definition")
	InvalidStructIdentifierError error = errors.New("expecting a valid struct identifier")
	InvalidStructBlockLCURError  error = errors.New("expecting a starting '{' of struct block")
	InvalidStructBlockRCURError  error = errors.New("expecting an ending '}' of struct block")
	InvalidStructFieldError      error = errors.New("expecting a valid struct field")

	InvalidUnionError           error = errors.New("expecting a valid union definition")
	InvalidUnionIdentifierError error = errors.New("expecting a valid union identifier")
	InvalidUnionBlockLCURError  error = errors.New("expecting a starting '{' of union block")
	InvalidUnionBlockRCURError  error = errors.New("expecting a ending '}' of union block")
	InvalidUnionFieldError      error = errors.New("expecting a valid union field")

	InvalidExceptionError           error = errors.New("expecting a valid exception definition")
	InvalidExceptionIdentifierError error = errors.New("expecting a valid exception identifier")
	InvalidExceptionBlockLCURError  error = errors.New("expecting a starting '{' of exception block")
	InvalidExceptionBlockRCURError  error = errors.New("expecting a ending '}' of exception block")
	InvalidExceptionFieldError      error = errors.New("expecting a valid exception field")

	InvalidEnumError                 error = errors.New("expecting a valid enum definition")
	InvalidEnumIdentifierError       error = errors.New("expecting a valid enum identifier")
	InvalidEnumBlockLCURError        error = errors.New("expecting a starting '{' of enum block")
	InvalidEnumBlockRCURError        error = errors.New("expecting a ending '}' of enum block")
	InvalidEnumValueError            error = errors.New("expecting a valid enum field")
	InvalidEnumValueIntConstantError error = errors.New("expecting a valid int contant")

	InvalidTypedefError           error = errors.New("expecting a valid typedef definition")
	InvalidTypedefIdentifierError error = errors.New("expecting a valid typedef identifier")

	InvalidConstError             error = errors.New("expecting a valid const definition")
	InvalidConstConstValueError   error = errors.New("expecting a valid const value")
	InvalidConstMissingValueError error = errors.New("expecting a const value")
	InvalidConstIdentifierError   error = errors.New("expecting a valid const identifier")

	InvalidServiceIdentifierError error = errors.New("expecting a valid service identifier")
	InvalidServiceBlockRCURError  error = errors.New("expecting a ending '}' of service block")
	InvalidServiceFunctionError   error = errors.New("expecting a valid service function")

	InvalidFunctionIdentifierError error = errors.New("expecting a valid function identifier")
	InvalidFunctionArgumentError   error = errors.New("expecting a valid function argument")

	InvalidIdentifierError error = errors.New("expecting a valid identifier")

	InvalidLiteral1MissingRightError error = errors.New("expecting a right \" ")
	InvalidLiteral1Error             error = errors.New("expecting a valid literal")
	InvalidLiteral2MissingRightError error = errors.New("expecting a right ' ")
	InvalidLiteral2Error             error = errors.New("expecting a valid literal")

	InvalidHeaderError error = errors.New("expecting a valid header")

	InvalidIncludeError    error = errors.New("expecting a valid include header")
	InvalidCppIncludeError error = errors.New("expecting a valid cpp include header")
	InvalidNamespaceError  error = errors.New("expecting a valid namespace header")

	InvalidDefinitionError error = errors.New("expecting a valid definition")

	InvalidServiceError error = errors.New("expecting a valid service definition")
)
View Source
var InvalidPosition = Position{
	Line:   -1,
	Col:    -1,
	Offset: -1,
}

Functions

func Parse

func Parse(filename string, b []byte, opts ...Option) (any, error)

Parse parses the data from b using filename as information in the error messages.

func ParseFile

func ParseFile(filename string, opts ...Option) (i any, err error)

ParseFile parses the file identified by filename.

func ParseReader

func ParseReader(filename string, r io.Reader, opts ...Option) (any, error)

ParseReader parses the data from r using filename as information in the error messages.

func StringPointer

func StringPointer(s string) *string

Types

type Annotation

type Annotation struct {
	EqualKeyword         *EqualKeyword
	ListSeparatorKeyword *ListSeparatorKeyword

	Identifier *Identifier
	Value      *Literal

	BadNode bool
	Location
}

func NewAnnotation

func NewAnnotation(equalKeyword *EqualKeyword, listSeparatorKeyword *ListSeparatorKeyword, id *Identifier, value *Literal, loc Location) *Annotation

func NewBadAnnotation

func NewBadAnnotation(loc Location) *Annotation

func (*Annotation) Children

func (a *Annotation) Children() []Node

func (*Annotation) ChildrenBadNode

func (a *Annotation) ChildrenBadNode() bool

func (*Annotation) Equals added in v0.1.4

func (a *Annotation) Equals(node Node) bool

func (*Annotation) IsBadNode

func (a *Annotation) IsBadNode() bool

func (*Annotation) Type

func (a *Annotation) Type() string

type Annotations

type Annotations struct {
	Annotations []*Annotation
	LParKeyword *LParKeyword
	RParKeyword *RParKeyword

	BadNode bool
	Location
}

func NewAnnotations

func NewAnnotations(lpar *LParKeyword, rpar *RParKeyword, annos []*Annotation, loc Location) *Annotations

func (*Annotations) Children

func (a *Annotations) Children() []Node

func (*Annotations) ChildrenBadNode

func (a *Annotations) ChildrenBadNode() bool

func (*Annotations) Equals added in v0.1.4

func (a *Annotations) Equals(node Node) bool

func (*Annotations) IsBadNode

func (a *Annotations) IsBadNode() bool

func (*Annotations) Type

func (a *Annotations) Type() string

type BadDefinition

type BadDefinition struct {
	BadNode bool
	Location
}

func NewBadDefinition

func NewBadDefinition(loc Location) *BadDefinition

func (*BadDefinition) Children

func (d *BadDefinition) Children() []Node

func (*BadDefinition) ChildrenBadNode

func (d *BadDefinition) ChildrenBadNode() bool

func (*BadDefinition) Equals added in v0.1.4

func (d *BadDefinition) Equals(node Node) bool

func (*BadDefinition) IsBadNode

func (d *BadDefinition) IsBadNode() bool

func (*BadDefinition) SetAnnotations

func (d *BadDefinition) SetAnnotations(annos *Annotations)

func (*BadDefinition) SetComments

func (d *BadDefinition) SetComments([]*Comment, []*Comment)

func (*BadDefinition) SetLocation

func (d *BadDefinition) SetLocation(loc Location)

func (*BadDefinition) Type

func (d *BadDefinition) Type() string

type BadHeader

type BadHeader struct {
	BadNode bool
	Location
}

func NewBadHeader

func NewBadHeader(loc Location) *BadHeader

func (*BadHeader) Children

func (h *BadHeader) Children() []Node

func (*BadHeader) ChildrenBadNode

func (h *BadHeader) ChildrenBadNode() bool

func (*BadHeader) Equals added in v0.1.4

func (h *BadHeader) Equals(node Node) bool

func (*BadHeader) IsBadNode

func (h *BadHeader) IsBadNode() bool

func (*BadHeader) SetComments

func (h *BadHeader) SetComments([]*Comment, []*Comment)

func (*BadHeader) SetLocation

func (h *BadHeader) SetLocation(loc Location)

func (*BadHeader) Type

func (h *BadHeader) Type() string

type CPPInclude

type CPPInclude struct {
	CPPIncludeKeyword *CPPIncludeKeyword
	Path              *Literal

	Comments        []*Comment
	EndLineComments []*Comment

	BadNode bool
	Location
}

func NewBadCPPInclude

func NewBadCPPInclude(loc Location) *CPPInclude

func NewCPPInclude

func NewCPPInclude(keyword *CPPIncludeKeyword, path *Literal, loc Location) *CPPInclude

func (*CPPInclude) Children

func (i *CPPInclude) Children() []Node

func (*CPPInclude) ChildrenBadNode

func (i *CPPInclude) ChildrenBadNode() bool

func (*CPPInclude) Equals added in v0.1.4

func (i *CPPInclude) Equals(node Node) bool

func (*CPPInclude) IsBadNode

func (i *CPPInclude) IsBadNode() bool

func (*CPPInclude) SetComments

func (i *CPPInclude) SetComments(comments []*Comment, endLineComments []*Comment)

func (*CPPInclude) SetLocation

func (i *CPPInclude) SetLocation(loc Location)

func (*CPPInclude) Type

func (i *CPPInclude) Type() string

type CPPIncludeKeyword

type CPPIncludeKeyword struct {
	Keyword
}

func (*CPPIncludeKeyword) Equals added in v0.1.4

func (c *CPPIncludeKeyword) Equals(node Node) bool

func (*CPPIncludeKeyword) Type

func (c *CPPIncludeKeyword) Type() string

type Cloner

type Cloner interface {
	Clone() any
}

Cloner is implemented by any value that has a Clone method, which returns a copy of the value. This is mainly used for types which are not passed by value (e.g map, slice, chan) or structs that contain such types.

This is used in conjunction with the global state feature to create proper copies of the state to allow the parser to properly restore the state in the case of backtracking.

type ColonKeyword

type ColonKeyword struct {
	Keyword
}

func (*ColonKeyword) Equals added in v0.1.4

func (c *ColonKeyword) Equals(node Node) bool

func (*ColonKeyword) Type

func (c *ColonKeyword) Type() string

type CommaKeyword

type CommaKeyword struct {
	Keyword
}

func (*CommaKeyword) Equals added in v0.1.4

func (r *CommaKeyword) Equals(node Node) bool

func (*CommaKeyword) Type

func (r *CommaKeyword) Type() string

type Comment

type Comment struct {
	Text  string
	Style CommentStyle // shell: #xxx, multiline: /* *** */, singleline: // xxxxx

	BadNode bool
	Location
}

func NewBadComment

func NewBadComment(loc Location) *Comment

func NewComment

func NewComment(text string, style CommentStyle, loc Location) *Comment

func (*Comment) Children

func (c *Comment) Children() []Node

func (*Comment) ChildrenBadNode

func (c *Comment) ChildrenBadNode() bool

func (*Comment) Equals added in v0.1.4

func (c *Comment) Equals(node Node) bool

func (*Comment) IsBadNode

func (c *Comment) IsBadNode() bool

func (*Comment) Type

func (c *Comment) Type() string

type CommentStyle

type CommentStyle string
const (
	CommentStyleShell      CommentStyle = "shell"
	CommentStyleMultiLine  CommentStyle = "multiline"
	CommentStyleSingleLine CommentStyle = "singleline"
)

type Const

type Const struct {
	ConstKeyword         *ConstKeyword
	EqualKeyword         *EqualKeyword
	ListSeparatorKeyword *ListSeparatorKeyword // can be nil
	Name                 *Identifier
	ConstType            *FieldType
	Value                *ConstValue

	Comments        []*Comment
	EndLineComments []*Comment
	Annotations     *Annotations

	BadNode bool
	Location
}

func NewBadConst

func NewBadConst(loc Location) *Const

func NewConst

func NewConst(constKeyword *ConstKeyword, equalKeyword *EqualKeyword, listSeparatorKeyword *ListSeparatorKeyword, name *Identifier, t *FieldType, v *ConstValue, loc Location) *Const

func (*Const) Children

func (c *Const) Children() []Node

func (*Const) ChildrenBadNode

func (c *Const) ChildrenBadNode() bool

func (*Const) Equals added in v0.1.4

func (c *Const) Equals(node Node) bool

func (*Const) IsBadNode

func (c *Const) IsBadNode() bool

func (*Const) SetAnnotations

func (c *Const) SetAnnotations(annos *Annotations)

func (*Const) SetComments

func (c *Const) SetComments(comments []*Comment, endLineComments []*Comment)

func (*Const) SetLocation

func (c *Const) SetLocation(loc Location)

func (*Const) Type

func (c *Const) Type() string

type ConstKeyword

type ConstKeyword struct {
	Keyword
}

func (*ConstKeyword) Equals added in v0.1.4

func (c *ConstKeyword) Equals(node Node) bool

func (*ConstKeyword) Type

func (c *ConstKeyword) Type() string

type ConstValue

type ConstValue struct {
	// TypeName can be: list, map, pair, string, identifier, i64, double
	TypeName string
	// Value is the actual value or identifier name
	Value any

	// ValueInText is the user input value
	// it is used for i64 and double type value
	ValueInText string

	// only exist when TypeName is map
	Key any

	// exist in list
	LBrkKeyword *LBrkKeyword
	RBrkKeyword *RBrkKeyword

	// exist in map
	LCurKeyword *LCurKeyword
	RCurKeyword *RCurKeyword

	// exist in list, map item
	ListSeparatorKeyword *ListSeparatorKeyword

	// exist in map item
	ColonKeyword *ColonKeyword

	Comments []*Comment

	BadNode bool
	Location
}

func NewBadConstValue

func NewBadConstValue(loc Location) *ConstValue

func NewBadIntConstValue

func NewBadIntConstValue(loc Location) *ConstValue

func NewConstValue

func NewConstValue(typeName string, value any, loc Location) *ConstValue

func NewMapConstValue

func NewMapConstValue(key, value *ConstValue, loc Location) *ConstValue

func (*ConstValue) Children

func (c *ConstValue) Children() []Node

TODO(jpf): nodes of key, value

func (*ConstValue) ChildrenBadNode

func (c *ConstValue) ChildrenBadNode() bool

func (*ConstValue) Equals added in v0.1.4

func (c *ConstValue) Equals(node Node) bool

func (*ConstValue) IsBadNode

func (c *ConstValue) IsBadNode() bool

func (*ConstValue) SetComments

func (c *ConstValue) SetComments(comments []*Comment)

func (*ConstValue) Type

func (c *ConstValue) Type() string

type CppType

type CppType struct {
	CppTypeKeyword *CppTypeKeyword
	Literal        *Literal

	BadNode bool
	Location
}

func NewCppType

func NewCppType(cppTypeKeyword *CppTypeKeyword, literal *Literal, loc Location) *CppType

func (*CppType) Children

func (c *CppType) Children() []Node

func (*CppType) ChildrenBadNode

func (c *CppType) ChildrenBadNode() bool

func (*CppType) Equals added in v0.1.4

func (c *CppType) Equals(node Node) bool

func (*CppType) IsBadNode

func (c *CppType) IsBadNode() bool

func (*CppType) Type

func (c *CppType) Type() string

type CppTypeKeyword

type CppTypeKeyword struct {
	Keyword
}

func (*CppTypeKeyword) Equals added in v0.1.4

func (r *CppTypeKeyword) Equals(node Node) bool

func (*CppTypeKeyword) Type

func (r *CppTypeKeyword) Type() string

type Definition

type Definition interface {
	Node
	Type() string
	SetComments(comments []*Comment, endLineComments []*Comment)
	SetAnnotations(annotations *Annotations)
	SetLocation(loc Location)
}

type Document

type Document struct {
	Filename string

	BadHeaders  []*BadHeader
	Includes    []*Include
	CPPIncludes []*CPPInclude
	Namespaces  []*Namespace

	Consts         []*Const
	Typedefs       []*Typedef
	Enums          []*Enum
	Services       []*Service
	Structs        []*Struct
	Unions         []*Union
	Exceptions     []*Exception
	BadDefinitions []*BadDefinition

	Comments []*Comment // Comments at end of doc

	Nodes []Node

	Location
}

func NewDocument

func NewDocument(headers []Header, defs []Definition, comments []*Comment, loc Location) *Document

func (*Document) Children

func (d *Document) Children() []Node

func (*Document) ChildrenBadNode

func (d *Document) ChildrenBadNode() bool

func (*Document) Equals added in v0.1.4

func (d *Document) Equals(node Node) bool

func (*Document) IsBadNode

func (d *Document) IsBadNode() bool

func (*Document) Type

func (d *Document) Type() string

type Enum

type Enum struct {
	EnumKeyword *EnumKeyword
	LCurKeyword *LCurKeyword
	RCurKeyword *RCurKeyword
	Name        *Identifier
	Values      []*EnumValue

	Comments        []*Comment
	EndLineComments []*Comment
	Annotations     *Annotations

	BadNode bool
	Location
}

func NewBadEnum

func NewBadEnum(loc Location) *Enum

func NewEnum

func NewEnum(enumKeyword *EnumKeyword, lCurKeyword *LCurKeyword, rCurKeyword *RCurKeyword, name *Identifier, values []*EnumValue, loc Location) *Enum

func (*Enum) Children

func (e *Enum) Children() []Node

func (*Enum) ChildrenBadNode

func (e *Enum) ChildrenBadNode() bool

func (*Enum) Equals added in v0.1.4

func (e *Enum) Equals(node Node) bool

func (*Enum) IsBadNode

func (e *Enum) IsBadNode() bool

func (*Enum) SetAnnotations

func (e *Enum) SetAnnotations(annos *Annotations)

func (*Enum) SetComments

func (e *Enum) SetComments(comments []*Comment, endlineComments []*Comment)

func (*Enum) SetLocation

func (e *Enum) SetLocation(loc Location)

func (*Enum) Type

func (e *Enum) Type() string

type EnumKeyword

type EnumKeyword struct {
	Keyword
}

func (*EnumKeyword) Equals added in v0.1.4

func (e *EnumKeyword) Equals(node Node) bool

func (*EnumKeyword) Type

func (e *EnumKeyword) Type() string

type EnumValue

type EnumValue struct {
	ListSeparatorKeyword *ListSeparatorKeyword // can be nil
	EqualKeyword         *EqualKeyword         // can be nil
	Name                 *Identifier
	ValueNode            *ConstValue
	Value                int64 // Value only record enum value. it is not a ast node
	Annotations          *Annotations
	Comments             []*Comment
	EndLineComments      []*Comment

	BadNode bool
	Location
}

func NewBadEnumValue

func NewBadEnumValue(loc Location) *EnumValue

func NewEnumValue

func NewEnumValue(listSeparatorKeyword *ListSeparatorKeyword, equalKeyword *EqualKeyword, name *Identifier, valueNode *ConstValue, value int64, annotations *Annotations, loc Location) *EnumValue

func (*EnumValue) Children

func (e *EnumValue) Children() []Node

func (*EnumValue) ChildrenBadNode

func (e *EnumValue) ChildrenBadNode() bool

func (*EnumValue) Equals added in v0.1.4

func (e *EnumValue) Equals(node Node) bool

func (*EnumValue) IsBadNode

func (e *EnumValue) IsBadNode() bool

func (*EnumValue) SetComments

func (e *EnumValue) SetComments(comments []*Comment, endLineComments []*Comment)

func (*EnumValue) Type

func (e *EnumValue) Type() string

type EqualKeyword

type EqualKeyword struct {
	Keyword
}

func NewBadEqualKeyword

func NewBadEqualKeyword() *EqualKeyword

func (*EqualKeyword) Equals added in v0.1.4

func (e *EqualKeyword) Equals(node Node) bool

func (*EqualKeyword) Type

func (e *EqualKeyword) Type() string

type ErrorLister

type ErrorLister interface {
	Errors() []error
}

ErrorLister is the public interface to access the inner errors included in a errList

type Exception

type Exception struct {
	ExceptionKeyword *ExceptionKeyword
	LCurKeyword      *LCurKeyword
	RCurKeyword      *RCurKeyword
	Name             *Identifier
	Fields           []*Field

	Comments        []*Comment
	EndLineComments []*Comment
	Annotations     *Annotations

	BadNode bool
	Location
}

func NewBadException

func NewBadException(loc Location) *Exception

func NewException

func NewException(exceptionKeyword *ExceptionKeyword, lCurKeyword *LCurKeyword, rCurKeyword *RCurKeyword, name *Identifier, fields []*Field, loc Location) *Exception

func (*Exception) Children

func (e *Exception) Children() []Node

func (*Exception) ChildrenBadNode

func (e *Exception) ChildrenBadNode() bool

func (*Exception) Equals added in v0.1.4

func (e *Exception) Equals(node Node) bool

func (*Exception) IsBadNode

func (e *Exception) IsBadNode() bool

func (*Exception) SetAnnotations

func (e *Exception) SetAnnotations(annos *Annotations)

func (*Exception) SetComments

func (e *Exception) SetComments(comments []*Comment, endLineComments []*Comment)

func (*Exception) SetLocation

func (e *Exception) SetLocation(loc Location)

func (*Exception) Type

func (e *Exception) Type() string

type ExceptionKeyword

type ExceptionKeyword struct {
	Keyword
}

func (*ExceptionKeyword) Equals added in v0.1.4

func (e *ExceptionKeyword) Equals(node Node) bool

func (*ExceptionKeyword) Type

func (e *ExceptionKeyword) Type() string

type ExtendsKeyword

type ExtendsKeyword struct {
	Keyword
}

func (*ExtendsKeyword) Equals added in v0.1.4

func (s *ExtendsKeyword) Equals(node Node) bool

func (*ExtendsKeyword) Type

func (s *ExtendsKeyword) Type() string

type Field

type Field struct {
	Index           *FieldIndex
	RequiredKeyword *RequiredKeyword
	FieldType       *FieldType
	Identifier      *Identifier
	ConstValue      *ConstValue

	EqualKeyword         *EqualKeyword         // can be nil
	ListSeparatorKeyword *ListSeparatorKeyword // can be nil

	Comments        []*Comment
	EndLineComments []*Comment
	Annotations     *Annotations

	BadNode bool
	Location
}

func NewBadField

func NewBadField(loc Location) *Field

func NewField

func NewField(equalKeyword *EqualKeyword, listSeparatorKeyword *ListSeparatorKeyword, comments []*Comment, endLineComments []*Comment, annotations *Annotations, index *FieldIndex, required *RequiredKeyword, fieldType *FieldType, identifier *Identifier, constValue *ConstValue, loc Location) *Field

func (*Field) Children

func (f *Field) Children() []Node

func (*Field) ChildrenBadNode

func (f *Field) ChildrenBadNode() bool

func (*Field) Equals added in v0.1.4

func (f *Field) Equals(node Node) bool

func (*Field) IsBadNode

func (f *Field) IsBadNode() bool

func (*Field) Type

func (f *Field) Type() string

type FieldIndex

type FieldIndex struct {
	ColonKeyword *ColonKeyword
	Value        int

	Comments []*Comment

	BadNode bool
	Location
}

func NewBadFieldIndex

func NewBadFieldIndex(loc Location) *FieldIndex

func NewFieldIndex

func NewFieldIndex(ColonKeyword *ColonKeyword, v int, comments []*Comment, loc Location) *FieldIndex

func (*FieldIndex) Children

func (f *FieldIndex) Children() []Node

func (*FieldIndex) ChildrenBadNode

func (f *FieldIndex) ChildrenBadNode() bool

func (*FieldIndex) Equals added in v0.1.4

func (f *FieldIndex) Equals(node Node) bool

func (*FieldIndex) IsBadNode

func (f *FieldIndex) IsBadNode() bool

func (*FieldIndex) Type

func (f *FieldIndex) Type() string

type FieldType

type FieldType struct {
	TypeName *TypeName
	// only exist when TypeName is map or set or list
	KeyType *FieldType
	// only exist when TypeName is map
	ValueType *FieldType

	// only exist in map, set, list. can be nil
	CppType *CppType

	// only exist in map, set, list
	LPointKeyword *LPointKeyword
	// only exist in map, set, list
	RPointKeyword *RPointKeyword
	// only exist in map
	CommaKeyword *CommaKeyword

	Annotations *Annotations

	BadNode bool

	Location
}

func NewFieldType

func NewFieldType(lpointKeyword *LPointKeyword, rpointKeyword *RPointKeyword, commaKeyword *CommaKeyword, cppType *CppType, typeName *TypeName, keyType *FieldType, valueType *FieldType, loc Location) *FieldType

func (*FieldType) Children

func (c *FieldType) Children() []Node

func (*FieldType) ChildrenBadNode

func (c *FieldType) ChildrenBadNode() bool

func (*FieldType) Equals added in v0.1.4

func (c *FieldType) Equals(node Node) bool

func (*FieldType) IsBadNode

func (c *FieldType) IsBadNode() bool

func (*FieldType) Type

func (c *FieldType) Type() string

type Function

type Function struct {
	LParKeyword          *LParKeyword
	RParKeyword          *RParKeyword
	ListSeparatorKeyword *ListSeparatorKeyword // can be nil
	Name                 *Identifier
	Oneway               *OnewayKeyword // can be nil
	Void                 *VoidKeyword   // can be nil
	FunctionType         *FieldType
	Arguments            []*Field
	Throws               *Throws
	Comments             []*Comment
	EndLineComments      []*Comment
	Annotations          *Annotations

	BadNode bool
	Location
}

func NewBadFunction

func NewBadFunction(loc Location) *Function

func NewFunction

func NewFunction(lParKeyword *LParKeyword, rParKeyword *RParKeyword, listSeparatorKeyword *ListSeparatorKeyword, name *Identifier, oneway *OnewayKeyword, void *VoidKeyword, ft *FieldType, args []*Field, throws *Throws, comments []*Comment, endlineComments []*Comment, annotations *Annotations, loc Location) *Function

func (*Function) Children

func (f *Function) Children() []Node

func (*Function) ChildrenBadNode

func (f *Function) ChildrenBadNode() bool

func (*Function) Equals added in v0.1.4

func (f *Function) Equals(node Node) bool

func (*Function) IsBadNode

func (f *Function) IsBadNode() bool

func (*Function) Type

func (f *Function) Type() string
type Header interface {
	Type() string
	SetComments(comments []*Comment, endLineComments []*Comment)
	SetLocation(loc Location)
	Node
}

type Identifier

type Identifier struct {
	Name     *IdentifierName
	Comments []*Comment

	BadNode bool
	Location
}

func NewBadIdentifier

func NewBadIdentifier(loc Location) *Identifier

func NewIdentifier

func NewIdentifier(name *IdentifierName, comments []*Comment, loc Location) *Identifier

func (*Identifier) Children

func (i *Identifier) Children() []Node

func (*Identifier) ChildrenBadNode

func (i *Identifier) ChildrenBadNode() bool

func (*Identifier) Equals added in v0.1.4

func (i *Identifier) Equals(node Node) bool

func (*Identifier) IsBadNode

func (i *Identifier) IsBadNode() bool

func (*Identifier) ToFieldType

func (i *Identifier) ToFieldType() *FieldType

func (*Identifier) Type

func (i *Identifier) Type() string

type IdentifierName

type IdentifierName struct {
	Text string

	BadNode bool
	Location
}

func NewIdentifierName

func NewIdentifierName(name string, loc Location) *IdentifierName

func (*IdentifierName) Children

func (i *IdentifierName) Children() []Node

func (*IdentifierName) ChildrenBadNode

func (i *IdentifierName) ChildrenBadNode() bool

func (*IdentifierName) Equals added in v0.1.4

func (i *IdentifierName) Equals(node Node) bool

func (*IdentifierName) IsBadNode

func (i *IdentifierName) IsBadNode() bool

func (*IdentifierName) Type

func (i *IdentifierName) Type() string

type Include

type Include struct {
	IncludeKeyword *IncludeKeyword
	Path           *Literal

	Comments        []*Comment
	EndLineComments []*Comment

	BadNode bool
	Location
}

func NewBadInclude

func NewBadInclude(loc Location) *Include

func NewInclude

func NewInclude(keyword *IncludeKeyword, path *Literal, loc Location) *Include

func (*Include) Children

func (i *Include) Children() []Node

func (*Include) ChildrenBadNode

func (i *Include) ChildrenBadNode() bool

func (*Include) Equals added in v0.1.4

func (i *Include) Equals(node Node) bool

func (*Include) IsBadNode

func (i *Include) IsBadNode() bool

func (*Include) Name

func (i *Include) Name() string

func (*Include) SetComments

func (i *Include) SetComments(comments []*Comment, endLineComments []*Comment)

func (*Include) SetLocation

func (i *Include) SetLocation(loc Location)

func (*Include) Type

func (i *Include) Type() string

type IncludeCall

type IncludeCall func(include string) (filename string, content []byte, err error)

type IncludeKeyword

type IncludeKeyword struct {
	Keyword
}

func (*IncludeKeyword) Equals added in v0.1.4

func (i *IncludeKeyword) Equals(node Node) bool

func (*IncludeKeyword) Type

func (i *IncludeKeyword) Type() string

type Keyword

type Keyword struct {
	Comments []*Comment
	Literal  *KeywordLiteral

	BadNode bool
	Location
}

func NewKeyword

func NewKeyword(comments []*Comment, literal *KeywordLiteral, loc Location) Keyword

func (*Keyword) Children

func (i *Keyword) Children() []Node

func (*Keyword) ChildrenBadNode

func (i *Keyword) ChildrenBadNode() bool

func (*Keyword) Equals added in v0.1.4

func (i *Keyword) Equals(k *Keyword) bool

func (*Keyword) IsBadNode

func (i *Keyword) IsBadNode() bool

type KeywordLiteral

type KeywordLiteral struct {
	Text    string
	BadNode bool
	Location
}

func NewBadKeywordLiteral

func NewBadKeywordLiteral(c *current) *KeywordLiteral

func NewKeywordLiteral

func NewKeywordLiteral(c *current) *KeywordLiteral

func (*KeywordLiteral) Children

func (k *KeywordLiteral) Children() []Node

func (*KeywordLiteral) ChildrenBadNode

func (k *KeywordLiteral) ChildrenBadNode() bool

func (*KeywordLiteral) Equals added in v0.1.4

func (k *KeywordLiteral) Equals(node Node) bool

func (*KeywordLiteral) IsBadNode

func (k *KeywordLiteral) IsBadNode() bool

func (*KeywordLiteral) Type

func (k *KeywordLiteral) Type() string

type LBrkKeyword

type LBrkKeyword struct {
	Keyword
}

func (*LBrkKeyword) Equals added in v0.1.4

func (l *LBrkKeyword) Equals(node Node) bool

func (*LBrkKeyword) Type

func (l *LBrkKeyword) Type() string

type LCurKeyword

type LCurKeyword struct {
	Keyword
}

func (*LCurKeyword) Equals added in v0.1.4

func (s *LCurKeyword) Equals(node Node) bool

func (*LCurKeyword) Type

func (s *LCurKeyword) Type() string

type LParKeyword

type LParKeyword struct {
	Keyword
}

func (*LParKeyword) Equals added in v0.1.4

func (l *LParKeyword) Equals(node Node) bool

func (*LParKeyword) Type

func (l *LParKeyword) Type() string

type LPointKeyword

type LPointKeyword struct {
	Keyword
}

func (*LPointKeyword) Equals added in v0.1.4

func (l *LPointKeyword) Equals(node Node) bool

func (*LPointKeyword) Type

func (l *LPointKeyword) Type() string

type ListSeparatorKeyword

type ListSeparatorKeyword struct {
	Keyword
	Text string // , or ;
}

func (*ListSeparatorKeyword) Equals added in v0.1.4

func (e *ListSeparatorKeyword) Equals(node Node) bool

func (*ListSeparatorKeyword) Type

func (e *ListSeparatorKeyword) Type() string

type Literal

type Literal struct {
	Value *LiteralValue

	Quote string // single for ', double for "

	Comments []*Comment

	BadNode bool
	Location
}

func NewBadLiteral

func NewBadLiteral(loc Location) *Literal

func NewLiteral

func NewLiteral(comments []*Comment, v *LiteralValue, quote string, loc Location) *Literal

TODO: 区分单引号还是双引号?

func (*Literal) Children

func (l *Literal) Children() []Node

func (*Literal) ChildrenBadNode

func (l *Literal) ChildrenBadNode() bool

func (*Literal) Equals added in v0.1.4

func (l *Literal) Equals(node Node) bool

func (*Literal) IsBadNode

func (l *Literal) IsBadNode() bool

func (*Literal) Type

func (l *Literal) Type() string

type LiteralValue

type LiteralValue struct {
	Text string

	BadNode bool
	Location
}

func NewBadLiteralValue

func NewBadLiteralValue(loc Location) *LiteralValue

func NewLiteralValue

func NewLiteralValue(text string, loc Location) *LiteralValue

func (*LiteralValue) Children

func (l *LiteralValue) Children() []Node

func (*LiteralValue) ChildrenBadNode

func (l *LiteralValue) ChildrenBadNode() bool

func (*LiteralValue) Equals added in v0.1.4

func (l *LiteralValue) Equals(node Node) bool

func (*LiteralValue) IsBadNode

func (l *LiteralValue) IsBadNode() bool

func (*LiteralValue) Type

func (l *LiteralValue) Type() string

type Location

type Location struct {
	StartPos Position
	EndPos   Position
}

func NewLocation

func NewLocation(startPos position, text string) Location

func NewLocationFromCurrent

func NewLocationFromCurrent(c *current) Location

func NewLocationFromPos

func NewLocationFromPos(start, end Position) Location

func (*Location) Contains

func (l *Location) Contains(pos Position) bool

func (*Location) End

func (l *Location) End() Position

end col and offset is excluded

func (Location) MoveStartInLine

func (l Location) MoveStartInLine(n int) Location

func (*Location) Pos

func (l *Location) Pos() Position

type Namespace

type Namespace struct {
	NamespaceKeyword *NamespaceKeyword
	Language         *NamespaceScope
	Name             *Identifier

	Annotations     *Annotations
	Comments        []*Comment
	EndLineComments []*Comment

	BadNode bool
	Location
}

func NewBadNamespace

func NewBadNamespace(loc Location) *Namespace

func NewNamespace

func NewNamespace(keyword *NamespaceKeyword, language *NamespaceScope, name *Identifier, annotations *Annotations, loc Location) *Namespace

func (*Namespace) Children

func (n *Namespace) Children() []Node

func (*Namespace) ChildrenBadNode

func (n *Namespace) ChildrenBadNode() bool

func (*Namespace) Equals added in v0.1.4

func (n *Namespace) Equals(node Node) bool

func (*Namespace) IsBadNode

func (n *Namespace) IsBadNode() bool

func (*Namespace) SetComments

func (n *Namespace) SetComments(comments []*Comment, endLineComments []*Comment)

func (*Namespace) SetLocation

func (n *Namespace) SetLocation(loc Location)

func (*Namespace) Type

func (n *Namespace) Type() string

type NamespaceKeyword

type NamespaceKeyword struct {
	Keyword
}

func (*NamespaceKeyword) Equals added in v0.1.4

func (n *NamespaceKeyword) Equals(node Node) bool

func (*NamespaceKeyword) Type

func (n *NamespaceKeyword) Type() string

type NamespaceScope

type NamespaceScope struct {
	Identifier
}

func (*NamespaceScope) Equals added in v0.1.4

func (ns *NamespaceScope) Equals(node Node) bool

type Node

type Node interface {
	// position of first charactor of this node
	Pos() Position
	// position of first charactor immediately after this node
	End() Position

	Contains(pos Position) bool

	Children() []Node

	Type() string

	IsBadNode() bool
	ChildrenBadNode() bool

	// Equals checks ast equals between two node
	Equals(node Node) bool
}

func SearchNodePathByPosition added in v0.0.9

func SearchNodePathByPosition(root Node, pos Position) []Node

type OnewayKeyword

type OnewayKeyword struct {
	Keyword
}

func (*OnewayKeyword) Equals added in v0.1.4

func (o *OnewayKeyword) Equals(node Node) bool

func (*OnewayKeyword) Type

func (o *OnewayKeyword) Type() string

type Option

type Option func(*parser) Option

Option is a function that can set an option on the parser. It returns the previous setting as an Option.

func AllowInvalidUTF8

func AllowInvalidUTF8(b bool) Option

AllowInvalidUTF8 creates an Option to allow invalid UTF-8 bytes. Every invalid UTF-8 byte is treated as a utf8.RuneError (U+FFFD) by character class matchers and is matched by the any matcher. The returned matched value, c.text and c.offset are NOT affected.

The default is false.

func Debug

func Debug(b bool) Option

Debug creates an Option to set the debug flag to b. When set to true, debugging information is printed to stdout while parsing.

The default is false.

func Entrypoint

func Entrypoint(ruleName string) Option

Entrypoint creates an Option to set the rule name to use as entrypoint. The rule name must have been specified in the -alternate-entrypoints if generating the parser with the -optimize-grammar flag, otherwise it may have been optimized out. Passing an empty string sets the entrypoint to the first rule in the grammar.

The default is to start parsing at the first rule in the grammar.

func GlobalStore

func GlobalStore(key string, value any) Option

GlobalStore creates an Option to set a key to a certain value in the globalStore.

func InitState

func InitState(key string, value any) Option

InitState creates an Option to set a key to a certain value in the global "state" store.

func MaxExpressions

func MaxExpressions(maxExprCnt uint64) Option

MaxExpressions creates an Option to stop parsing after the provided number of expressions have been parsed, if the value is 0 then the parser will parse for as many steps as needed (possibly an infinite number).

The default for maxExprCnt is 0.

func Memoize

func Memoize(b bool) Option

Memoize creates an Option to set the memoize flag to b. When set to true, the parser will cache all results so each expression is evaluated only once. This guarantees linear parsing time even for pathological cases, at the expense of more memory and slower times for typical cases.

The default is false.

func Recover

func Recover(b bool) Option

Recover creates an Option to set the recover flag to b. When set to true, this causes the parser to recover from panics and convert it to an error. Setting it to false can be useful while debugging to access the full stack trace.

The default is true.

func Statistics

func Statistics(stats *Stats, choiceNoMatch string) Option

Statistics adds a user provided Stats struct to the parser to allow the user to process the results after the parsing has finished. Also the key for the "no match" counter is set.

Example usage:

input := "input"
stats := Stats{}
_, err := Parse("input-file", []byte(input), Statistics(&stats, "no match"))
if err != nil {
    log.Panicln(err)
}
b, err := json.MarshalIndent(stats.ChoiceAltCnt, "", "  ")
if err != nil {
    log.Panicln(err)
}
fmt.Println(string(b))

type PEGParser

type PEGParser struct {
	// contains filtered or unexported fields
}

PEGParser use PEG as a parser implementation

func (*PEGParser) Parse

func (p *PEGParser) Parse(filename string, content []byte) (*Document, []error)

func (*PEGParser) ParseRecursively

func (p *PEGParser) ParseRecursively(filename string, content []byte, maxDepth int, call IncludeCall) []*ParseResult

type ParseResult

type ParseResult struct {
	Doc    *Document
	Errors []error
}

type Parser

type Parser interface {
	Parse(filename string, content []byte) *ParseResult
	ParseRecursively(filename string, content []byte, maxDepth int, call IncludeCall) []*ParseResult
}

type ParserError

type ParserError interface {
	Error() string
	InnerError() error
	Pos() (int, int, int)
	Expected() []string
}

ParserError is the public interface to errors of type parserError

type Position

type Position struct {
	Line   int // 1-based line number
	Col    int // 1-based rune count from start of line.
	Offset int // 0-based byte offset
}

func ConvertPosition

func ConvertPosition(pos position) Position

func (*Position) Equal

func (p *Position) Equal(other Position) bool

func (*Position) Greater

func (p *Position) Greater(other Position) bool

func (*Position) Invalid

func (p *Position) Invalid() bool

func (*Position) Less

func (p *Position) Less(other Position) bool

type RBrkKeyword

type RBrkKeyword struct {
	Keyword
}

func (*RBrkKeyword) Equals added in v0.1.4

func (l *RBrkKeyword) Equals(node Node) bool

func (*RBrkKeyword) Type

func (l *RBrkKeyword) Type() string

type RCurKeyword

type RCurKeyword struct {
	Keyword
}

func (*RCurKeyword) Equals added in v0.1.4

func (s *RCurKeyword) Equals(node Node) bool

func (*RCurKeyword) Type

func (s *RCurKeyword) Type() string

type RParKeyword

type RParKeyword struct {
	Keyword
}

func (*RParKeyword) Equals added in v0.1.4

func (r *RParKeyword) Equals(node Node) bool

func (*RParKeyword) Type

func (r *RParKeyword) Type() string

type RPointKeyword

type RPointKeyword struct {
	Keyword
}

func (*RPointKeyword) Equals added in v0.1.4

func (r *RPointKeyword) Equals(node Node) bool

func (*RPointKeyword) Type

func (r *RPointKeyword) Type() string

type RequiredKeyword

type RequiredKeyword struct {
	Keyword
}

func (*RequiredKeyword) Equals added in v0.1.4

func (r *RequiredKeyword) Equals(node Node) bool

func (*RequiredKeyword) Type

func (r *RequiredKeyword) Type() string

type Service

type Service struct {
	ServiceKeyword *ServiceKeyword
	ExtendsKeyword *ExtendsKeyword // can be nil
	LCurKeyword    *LCurKeyword
	RCurKeyword    *RCurKeyword
	Name           *Identifier
	Extends        *Identifier
	Functions      []*Function

	Comments        []*Comment
	EndLineComments []*Comment
	Annotations     *Annotations

	BadNode bool
	Location
}

func NewBadService

func NewBadService(loc Location) *Service

func NewService

func NewService(serviceKeyword *ServiceKeyword, extendsKeyword *ExtendsKeyword, lCurKeyword *LCurKeyword, rCurKeyword *RCurKeyword, name *Identifier, extends *Identifier, fns []*Function, loc Location) *Service

func (*Service) Children

func (s *Service) Children() []Node

func (*Service) ChildrenBadNode

func (s *Service) ChildrenBadNode() bool

func (*Service) Equals added in v0.1.4

func (s *Service) Equals(node Node) bool

func (*Service) IsBadNode

func (s *Service) IsBadNode() bool

func (*Service) SetAnnotations

func (s *Service) SetAnnotations(annos *Annotations)

func (*Service) SetComments

func (s *Service) SetComments(comments []*Comment, endLineComments []*Comment)

func (*Service) SetLocation

func (s *Service) SetLocation(loc Location)

func (*Service) Type

func (s *Service) Type() string

type ServiceKeyword

type ServiceKeyword struct {
	Keyword
}

func (*ServiceKeyword) Equals added in v0.1.4

func (s *ServiceKeyword) Equals(node Node) bool

func (*ServiceKeyword) Type

func (s *ServiceKeyword) Type() string

type Stats

type Stats struct {
	// ExprCnt counts the number of expressions processed during parsing
	// This value is compared to the maximum number of expressions allowed
	// (set by the MaxExpressions option).
	ExprCnt uint64

	// ChoiceAltCnt is used to count for each ordered choice expression,
	// which alternative is used how may times.
	// These numbers allow to optimize the order of the ordered choice expression
	// to increase the performance of the parser
	//
	// The outer key of ChoiceAltCnt is composed of the name of the rule as well
	// as the line and the column of the ordered choice.
	// The inner key of ChoiceAltCnt is the number (one-based) of the matching alternative.
	// For each alternative the number of matches are counted. If an ordered choice does not
	// match, a special counter is incremented. The name of this counter is set with
	// the parser option Statistics.
	// For an alternative to be included in ChoiceAltCnt, it has to match at least once.
	ChoiceAltCnt map[string]map[string]int
}

Stats stores some statistics, gathered during parsing

type Struct

type Struct struct {
	StructKeyword *StructKeyword
	LCurKeyword   *LCurKeyword
	RCurKeyword   *RCurKeyword
	Identifier    *Identifier
	Fields        []*Field

	Comments        []*Comment
	EndLineComments []*Comment
	Annotations     *Annotations

	BadNode bool
	Location
}

func NewBadStruct

func NewBadStruct(loc Location) *Struct

func NewStruct

func NewStruct(structKeyword *StructKeyword, lCurKeyword *LCurKeyword, rCurKeyword *RCurKeyword, identifier *Identifier, fields []*Field, loc Location) *Struct

func (*Struct) Children

func (s *Struct) Children() []Node

func (*Struct) ChildrenBadNode

func (s *Struct) ChildrenBadNode() bool

func (*Struct) Equals added in v0.1.4

func (s *Struct) Equals(node Node) bool

func (*Struct) IsBadNode

func (s *Struct) IsBadNode() bool

func (*Struct) SetAnnotations

func (s *Struct) SetAnnotations(annos *Annotations)

func (*Struct) SetComments

func (s *Struct) SetComments(comments []*Comment, endLineComments []*Comment)

func (*Struct) SetLocation

func (s *Struct) SetLocation(loc Location)

func (*Struct) Type

func (s *Struct) Type() string

type StructKeyword

type StructKeyword struct {
	Keyword
}

func (*StructKeyword) Equals added in v0.1.4

func (s *StructKeyword) Equals(node Node) bool

func (*StructKeyword) Type

func (s *StructKeyword) Type() string

type Throws

type Throws struct {
	ThrowsKeyword *ThrowsKeyword
	LParKeyword   *LParKeyword
	RParKeyword   *RParKeyword

	Fields []*Field

	BadNode bool
	Location
}

func NewThrows

func NewThrows(throwsKeyword *ThrowsKeyword, lparKeyword *LParKeyword, rparKeyword *RParKeyword, fields []*Field, loc Location) *Throws

func (*Throws) Children

func (t *Throws) Children() []Node

func (*Throws) ChildrenBadNode

func (t *Throws) ChildrenBadNode() bool

func (*Throws) Equals added in v0.1.4

func (t *Throws) Equals(node Node) bool

func (*Throws) IsBadNode

func (t *Throws) IsBadNode() bool

func (*Throws) Type

func (t *Throws) Type() string

type ThrowsKeyword

type ThrowsKeyword struct {
	Keyword
}

func (*ThrowsKeyword) Equals added in v0.1.4

func (t *ThrowsKeyword) Equals(node Node) bool

func (*ThrowsKeyword) Type

func (t *ThrowsKeyword) Type() string

type TypeName

type TypeName struct {
	// TypeName can be:
	// container type: map, set, list
	// base type: bool, byte, i8, i16, i32, i64, double, string, binary
	// struct, enum, union, exception, identifier
	Name     string
	Comments []*Comment

	BadNode bool
	Location
}

func NewTypeName

func NewTypeName(name string, pos position) *TypeName

func (*TypeName) Children

func (t *TypeName) Children() []Node

func (*TypeName) ChildrenBadNode

func (t *TypeName) ChildrenBadNode() bool

func (*TypeName) Equals added in v0.1.4

func (t *TypeName) Equals(node Node) bool

func (*TypeName) IsBadNode

func (t *TypeName) IsBadNode() bool

func (*TypeName) Type

func (t *TypeName) Type() string

type Typedef

type Typedef struct {
	TypedefKeyword *TypedefKeyword
	T              *FieldType
	Alias          *Identifier

	Comments        []*Comment
	EndLineComments []*Comment
	Annotations     *Annotations
	BadNode         bool

	Location
}

func NewBadTypedef

func NewBadTypedef(loc Location) *Typedef

func NewTypedef

func NewTypedef(keyword *TypedefKeyword, t *FieldType, alias *Identifier, loc Location) *Typedef

func (*Typedef) Children

func (t *Typedef) Children() []Node

func (*Typedef) ChildrenBadNode

func (t *Typedef) ChildrenBadNode() bool

func (*Typedef) Equals added in v0.1.4

func (t *Typedef) Equals(node Node) bool

func (*Typedef) IsBadNode

func (t *Typedef) IsBadNode() bool

func (*Typedef) SetAnnotations

func (t *Typedef) SetAnnotations(annos *Annotations)

func (*Typedef) SetComments

func (t *Typedef) SetComments(comments []*Comment, endLineComments []*Comment)

func (*Typedef) SetLocation

func (t *Typedef) SetLocation(loc Location)

func (*Typedef) Type

func (t *Typedef) Type() string

type TypedefKeyword

type TypedefKeyword struct {
	Keyword
}

func (*TypedefKeyword) Equals added in v0.1.4

func (t *TypedefKeyword) Equals(node Node) bool

func (*TypedefKeyword) Type

func (t *TypedefKeyword) Type() string

type Union

type Union struct {
	UnionKeyword *UnionKeyword
	LCurKeyword  *LCurKeyword
	RCurKeyword  *RCurKeyword
	Name         *Identifier
	Fields       []*Field

	Comments        []*Comment
	EndLineComments []*Comment
	Annotations     *Annotations

	BadNode bool
	Location
}

func NewBadUnion

func NewBadUnion(loc Location) *Union

func NewUnion

func NewUnion(unionKeyword *UnionKeyword, lCurKeyword *LCurKeyword, rCurKeyword *RCurKeyword, name *Identifier, fields []*Field, loc Location) *Union

func (*Union) Children

func (u *Union) Children() []Node

func (*Union) ChildrenBadNode

func (u *Union) ChildrenBadNode() bool

func (*Union) Equals added in v0.1.4

func (u *Union) Equals(node Node) bool

func (*Union) IsBadNode

func (u *Union) IsBadNode() bool

func (*Union) SetAnnotations

func (u *Union) SetAnnotations(annos *Annotations)

func (*Union) SetComments

func (u *Union) SetComments(comments []*Comment, endLineComments []*Comment)

func (*Union) SetLocation

func (u *Union) SetLocation(loc Location)

func (*Union) Type

func (u *Union) Type() string

type UnionKeyword

type UnionKeyword struct {
	Keyword
}

func (*UnionKeyword) Equals added in v0.1.4

func (u *UnionKeyword) Equals(node Node) bool

func (*UnionKeyword) Type

func (u *UnionKeyword) Type() string

type VoidKeyword

type VoidKeyword struct {
	Keyword
}

func (*VoidKeyword) Equals added in v0.1.4

func (v *VoidKeyword) Equals(node Node) bool

func (*VoidKeyword) Type

func (v *VoidKeyword) Type() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL