Documentation
¶
Index ¶
- Constants
- type Lexeme
- func (lex Lexeme) Begin() bytes.Index
- func (lex Lexeme) End() bytes.Index
- func (lex Lexeme) File() *fs.File
- func (lex *Lexeme) SetBegin(begin bytes.Index)
- func (lex *Lexeme) SetEnd(end bytes.Index)
- func (lex *Lexeme) SetFile(file *fs.File)
- func (lex *Lexeme) SetType(t LexemeType)
- func (lex Lexeme) String() string
- func (lex Lexeme) Type() LexemeType
- func (lex Lexeme) Value() bytes.Bytes
- type LexemeEvent
- type LexemeEventType
- type LexemeType
- type Scanner
Constants ¶
View Source
const ( EOF byte = 0 // used to imitate end of file CommentSign = '#' AnnotationDelimiterPart = '/' ObjectOpen = '{' ArrayOpen = '[' ContextOpenSign = '(' ContextCloseSign = ')' LinkSymbol = '@' DoubleQuote = '"' RegexDelimiter = '/' )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lexeme ¶
type Lexeme struct {
// contains filtered or unexported fields
}
func (*Lexeme) SetType ¶
func (lex *Lexeme) SetType(t LexemeType)
func (Lexeme) Type ¶
func (lex Lexeme) Type() LexemeType
type LexemeEvent ¶
type LexemeEvent struct {
// contains filtered or unexported fields
}
type LexemeEventType ¶
type LexemeEventType uint8
const ( KeywordBegin LexemeEventType = iota KeywordEnd ParameterBegin ParameterEnd AnnotationBegin AnnotationEnd SchemaBegin SchemaEnd JsonArrayBegin JsonArrayEnd TextBegin TextEnd ContextOpen ContextClose )
func (LexemeEventType) IsBeginning ¶
func (e LexemeEventType) IsBeginning() bool
func (LexemeEventType) IsEnding ¶
func (e LexemeEventType) IsEnding() bool
func (LexemeEventType) IsSingle ¶
func (e LexemeEventType) IsSingle() bool
func (LexemeEventType) String ¶
func (e LexemeEventType) String() string
func (LexemeEventType) ToLexemeType ¶
func (e LexemeEventType) ToLexemeType() LexemeType
type LexemeType ¶
type LexemeType uint8
const ( Keyword LexemeType = iota // Name of a Directive, i.e. URL, GET, Path, 200, etc Parameter // Parameter for directive (regexp/jsight fot TYPE) Annotation // user's annotation to directive in a free-text form Schema // jSchema inside directive's body (Body, TYPE, 200, etc) Json // json inside directive's body (CONFIG) Array // Array of string values inside ENUM body Text // Text inside directive Description body ContextExplicitOpening // Explicitly opens context, so that it can ba later explicitly closed ContextExplicitClosing // Explicitly opens context, so that it can ba later explicitly closed )
func (LexemeType) String ¶
func (t LexemeType) String() string
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
func NewJApiScanner ¶
func (*Scanner) CurrentIndex ¶
func (*Scanner) Next ¶
Next reads japi file by bytes, detects lexemes beginnings and ends and returns them as soon as they found returns false for the end of file
func (*Scanner) SetCurrentIndex ¶
SetCurrentIndex to continue scanning from certain position
Source Files
¶
- constants.go
- errors.go
- lexeme-event-stack.go
- lexeme-event.go
- lexeme.go
- scanner.go
- step-helpers.go
- step-stack.go
- steps-baseurl.go
- steps-body.go
- steps-comments.go
- steps-description.go
- steps-directive-annotation.go
- steps-directive-parameters.go
- steps-enum.go
- steps-headers.go
- steps-http-methods.go
- steps-info.go
- steps-jsight.go
- steps-macro.go
- steps-paste.go
- steps-path.go
- steps-query.go
- steps-request.go
- steps-response-codes.go
- steps-schema-jsight.go
- steps-schema-regex.go
- steps-server.go
- steps-title.go
- steps-type.go
- steps-url.go
- steps-version.go
- steps.go
Click to show internal directories.
Click to hide internal directories.