Documentation
¶
Index ¶
- Constants
- type Arithmetic
- type ArithmeticOrType
- type Combinator
- type Constructor
- type Field
- type FieldMask
- type LexerOptions
- type Modifier
- type Name
- type ParseError
- type Position
- type PositionRange
- type RepeatWithScale
- type ScaleFactor
- type TL
- func (tl TL) Generate2TL() string
- func (tl TL) GenerateTLO(version uint32) (tls.SchemaV4, error)
- func (tl TL) StreamGenerate2TL(qw422016 *qt422016.Writer)
- func (tl TL) StreamString(qw422016 *qt422016.Writer)
- func (tl TL) String() string
- func (tl TL) ToDot() string
- func (tl TL) WriteGenerate2TL(qq422016 qtio422016.Writer)
- func (tl TL) WriteString(qq422016 qtio422016.Writer)
- type TemplateArgument
- type TypeDeclaration
- type TypeRef
Constants ¶
View Source
const ContactAuthorsString = "please check/create issue with example https://github.com/VKCOM/tl/issues" // TODO move to better place
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arithmetic ¶
func (Arithmetic) IsEmpty ¶
func (a Arithmetic) IsEmpty() bool
func (Arithmetic) StreamString ¶ added in v1.0.3
func (a Arithmetic) StreamString(qw422016 *qt422016.Writer)
func (Arithmetic) String ¶
func (a Arithmetic) String() string
func (Arithmetic) WriteString ¶ added in v1.0.3
func (a Arithmetic) WriteString(qq422016 qtio422016.Writer)
type ArithmeticOrType ¶
type ArithmeticOrType struct { IsArith bool Arith Arithmetic T TypeRef // PR of T can also be used for Arith }
func (ArithmeticOrType) StreamString ¶ added in v1.0.3
func (aot ArithmeticOrType) StreamString(qw422016 *qt422016.Writer)
func (ArithmeticOrType) String ¶
func (aot ArithmeticOrType) String() string
func (ArithmeticOrType) WriteString ¶ added in v1.0.3
func (aot ArithmeticOrType) WriteString(qq422016 qtio422016.Writer)
type Combinator ¶
type Combinator struct { Builtin bool IsFunction bool Modifiers []Modifier // TODO - rename to annotations Construct Constructor TemplateArguments []TemplateArgument Fields []Field TypeDecl TypeDeclaration FuncDecl TypeRef OriginalDescriptor *Combinator // hack - if some replacements were made, original descriptor is saved here OriginalOrderIndex int // declaration order index (needed in TLO generation) TemplateArgumentsPR PositionRange // especially useful when 0 arguments PR PositionRange CommentBefore string // comment before combinator CommentRight string // comment to the right of combinator }
func (*Combinator) Crc32 ¶
func (descriptor *Combinator) Crc32() uint32
Crc32 returns tag of Combinator if tag not set explicitly Crc32 will calculate hash of Combinator in canonical form canonicalForm returns combinator in "canonical" form which is used for
- combinator is written in one line
- curly braces: '{', '}' are omitted
- all tokens are separates from each other with one space
- square brackets are also separated from content inside with one space example: "[ T ]"
func (Combinator) StreamString ¶ added in v1.0.3
func (descriptor Combinator) StreamString(qw422016 *qt422016.Writer)
func (Combinator) String ¶
func (descriptor Combinator) String() string
func (Combinator) WriteString ¶ added in v1.0.3
func (descriptor Combinator) WriteString(qq422016 qtio422016.Writer)
type Constructor ¶
type Constructor struct { Name Name ID *uint32 // TODO - uint32 + bool IsExplicit NamePR PositionRange IDPR PositionRange }
func (Constructor) StreamString ¶ added in v1.0.3
func (c Constructor) StreamString(qw422016 *qt422016.Writer)
func (Constructor) String ¶
func (c Constructor) String() string
func (Constructor) WriteString ¶ added in v1.0.3
func (c Constructor) WriteString(qq422016 qtio422016.Writer)
type Field ¶
type Field struct { FieldName string Mask *FieldMask Excl bool IsRepeated bool ScaleRepeat RepeatWithScale FieldType TypeRef PR PositionRange PRName PositionRange CommentBefore string // comment before field CommentRight string // comment to the right of field }
func (Field) StreamString ¶ added in v1.0.3
func (Field) WriteString ¶ added in v1.0.3
func (f Field) WriteString(qq422016 qtio422016.Writer)
type FieldMask ¶
type FieldMask struct { MaskName string BitNumber uint32 PRName PositionRange PRBits PositionRange }
func (FieldMask) StreamString ¶ added in v1.0.3
func (FieldMask) WriteString ¶ added in v1.0.3
func (fm FieldMask) WriteString(qq422016 qtio422016.Writer)
type LexerOptions ¶ added in v1.1.12
type LexerOptions struct { AllowBuiltin bool // allows constructor to start from '_' (underscore), used only internally by tlgen AllowDirty bool // allows to use '_' (underscore) as constructor name, will be removed after combined.tl is cleaned up AllowMLC bool // allow multiline comments. They are treated as warnings. }
type Modifier ¶
type Modifier struct { Name string PR PositionRange }
type Name ¶
func (Name) StreamString ¶ added in v1.0.3
func (Name) WriteString ¶ added in v1.0.3
func (n Name) WriteString(qq422016 qtio422016.Writer)
type ParseError ¶
type ParseError struct { Err error Pos PositionRange // contains filtered or unexported fields }
func BeautifulError2 ¶
func BeautifulError2(original *ParseError, compare *ParseError) *ParseError
func (*ParseError) ConsolePrint ¶
func (e *ParseError) ConsolePrint(out io.Writer, outmostError error, isWarning bool)
func (ParseError) Error ¶
func (e ParseError) Error() string
func (*ParseError) PrintWarning ¶ added in v1.0.6
func (e *ParseError) PrintWarning(out io.Writer, outmostError error)
func (ParseError) Unwrap ¶
func (e ParseError) Unwrap() error
type PositionRange ¶
type PositionRange struct { Outer Position // in lexer, it is empty, in parser set to start of combinator Begin Position End Position }
func (PositionRange) BeautifulError ¶
func (pr PositionRange) BeautifulError(err error) *ParseError
func (PositionRange) CheckValidity ¶
func (pr PositionRange) CheckValidity()
func (PositionRange) CollapseToBegin ¶
func (pr PositionRange) CollapseToBegin() PositionRange
func (PositionRange) CollapseToEnd ¶
func (pr PositionRange) CollapseToEnd() PositionRange
type RepeatWithScale ¶
type RepeatWithScale struct { ExplicitScale bool Scale ScaleFactor Rep []Field PR PositionRange }
func (RepeatWithScale) StreamString ¶ added in v1.0.3
func (rws RepeatWithScale) StreamString(qw422016 *qt422016.Writer)
func (RepeatWithScale) String ¶
func (rws RepeatWithScale) String() string
func (RepeatWithScale) WriteString ¶ added in v1.0.3
func (rws RepeatWithScale) WriteString(qq422016 qtio422016.Writer)
type ScaleFactor ¶
type ScaleFactor struct { IsArith bool Arith Arithmetic Scale string PR PositionRange }
func (ScaleFactor) IsEmpty ¶
func (sf ScaleFactor) IsEmpty() bool
func (ScaleFactor) StreamString ¶ added in v1.0.3
func (sf ScaleFactor) StreamString(qw422016 *qt422016.Writer)
func (ScaleFactor) String ¶
func (sf ScaleFactor) String() string
func (ScaleFactor) WriteString ¶ added in v1.0.3
func (sf ScaleFactor) WriteString(qq422016 qtio422016.Writer)
type TL ¶
type TL []*Combinator
func ParseTLFile ¶
ParseTL2 TL := TypesSection [ type ... ] FunctionSection [ function ... ]
func (TL) Generate2TL ¶ added in v1.0.3
func (TL) GenerateTLO ¶ added in v1.0.4
func (TL) StreamGenerate2TL ¶ added in v1.0.3
func (TL) StreamString ¶ added in v1.0.3
func (TL) WriteGenerate2TL ¶ added in v1.0.3
func (tl TL) WriteGenerate2TL(qq422016 qtio422016.Writer)
func (TL) WriteString ¶ added in v1.0.3
func (tl TL) WriteString(qq422016 qtio422016.Writer)
type TemplateArgument ¶
type TemplateArgument struct { FieldName string IsNat bool PR PositionRange // TODO - split into type and name }
func (TemplateArgument) StreamString ¶ added in v1.0.3
func (ta TemplateArgument) StreamString(qw422016 *qt422016.Writer)
func (TemplateArgument) String ¶
func (ta TemplateArgument) String() string
func (TemplateArgument) WriteString ¶ added in v1.0.3
func (ta TemplateArgument) WriteString(qq422016 qtio422016.Writer)
type TypeDeclaration ¶
type TypeDeclaration struct { Name Name Arguments []string PR PositionRange NamePR PositionRange ArgumentsPR []PositionRange }
func (TypeDeclaration) StreamString ¶ added in v1.0.3
func (d TypeDeclaration) StreamString(qw422016 *qt422016.Writer)
func (TypeDeclaration) String ¶
func (d TypeDeclaration) String() string
func (TypeDeclaration) WriteString ¶ added in v1.0.3
func (d TypeDeclaration) WriteString(qq422016 qtio422016.Writer)
type TypeRef ¶
type TypeRef struct { Type Name Args []ArithmeticOrType Bare bool PR PositionRange PRArgs PositionRange }
func (TypeRef) StreamString ¶ added in v1.0.3
func (TypeRef) WriteString ¶ added in v1.0.3
func (t TypeRef) WriteString(qq422016 qtio422016.Writer)
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
gentlo
|
|
constants
Code generated by vktl/cmd/tlgen2; DO NOT EDIT.
|
Code generated by vktl/cmd/tlgen2; DO NOT EDIT. |
factory
Code generated by vktl/cmd/tlgen2; DO NOT EDIT.
|
Code generated by vktl/cmd/tlgen2; DO NOT EDIT. |
internal
Code generated by vktl/cmd/tlgen2; DO NOT EDIT.
|
Code generated by vktl/cmd/tlgen2; DO NOT EDIT. |
meta
Code generated by vktl/cmd/tlgen2; DO NOT EDIT.
|
Code generated by vktl/cmd/tlgen2; DO NOT EDIT. |
tltls
Code generated by vktl/cmd/tlgen2; DO NOT EDIT.
|
Code generated by vktl/cmd/tlgen2; DO NOT EDIT. |
Click to show internal directories.
Click to hide internal directories.