Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ParseError ¶
type ParseError struct { // Input is the text to parse Input string // Msg s the error message Msg string // Post is where in the input the error occurred Pos int }
ParseError represents a parsing error
func (*ParseError) Error ¶
func (t *ParseError) Error() string
type Token ¶
type Token struct { // Type is the token type Typ TokenType // Val the textual content Val string // Pos is the token position in the input Pos int }
Token has a type, a value and a position in the input
type TokenType ¶
type TokenType string
TokenType is a type representing the different kinds of tokens
const ( // TTArg is an arg token, e.g. ARG, SRC. DST TTArg TokenType = "Arg" // TTOpenPar ( TTOpenPar TokenType = "OpenPar" // TTClosePar ) TTClosePar TokenType = "ClosePar" // TTOpenSq [ TTOpenSq TokenType = "OpenSq" // TTCloseSq ] TTCloseSq TokenType = "CloseSq" // TTChoice | TTChoice TokenType = "Choice" // TTOptions is the special OPTIONS keyword TTOptions TokenType = "Options" // TTRep ... TTRep TokenType = "Rep" // TTShortOpt -a, -f, ... TTShortOpt TokenType = "ShortOpt" // TTLongOpt --force, --retry, ... TTLongOpt TokenType = "LongOpt" // TTOptSeq a folded option sequence, -rm TTOptSeq TokenType = "OptSeq" // TTOptValue is the special =<example> syntax token TTOptValue TokenType = "OptValue" // TTDoubleDash -- TTDoubleDash TokenType = "DblDash" )
Click to show internal directories.
Click to hide internal directories.