Documentation ¶
Index ¶
- Constants
- func IsLValue(expr Expr) bool
- func SpecialVarIndex(name string) int
- type Action
- type ArrayExpr
- type AssignExpr
- type AugAssignExpr
- type BinaryExpr
- type BlockStmt
- type BreakStmt
- type CallExpr
- type CondExpr
- type ContinueStmt
- type DeleteStmt
- type DoWhileStmt
- type ExitStmt
- type Expr
- type ExprStmt
- type FieldExpr
- type ForInStmt
- type ForStmt
- type Function
- type GetlineExpr
- type IfStmt
- type InExpr
- type IncrExpr
- type IndexExpr
- type MultiExpr
- type NextStmt
- type NumExpr
- type PrintStmt
- type PrintfStmt
- type RegExpr
- type ReturnStmt
- type Stmt
- type Stmts
- type StrExpr
- type UnaryExpr
- type UserCallExpr
- type VarExpr
- type VarScope
- type WhileStmt
Constants ¶
const ( V_ILLEGAL = iota V_ARGC V_CONVFMT V_FILENAME V_FNR V_FS V_NF V_NR V_OFMT V_OFS V_ORS V_RLENGTH V_RS V_RSTART V_SUBSEP V_LAST = V_SUBSEP )
Variables ¶
This section is empty.
Functions ¶
func IsLValue ¶
IsLValue returns true if the given expression can be used as an lvalue (on the left-hand side of an assignment, in a ++ or -- operation, or as the third argument to sub or gsub).
func SpecialVarIndex ¶
SpecialVarIndex returns the "index" of the special variable, or 0 if it's not a special variable.
Types ¶
type ArrayExpr ¶
Array reference. Not really a stand-alone expression, except as an argument to split() or a user function call.
type AssignExpr ¶
Assignment expression like x = 1234.
func (*AssignExpr) String ¶
func (e *AssignExpr) String() string
type AugAssignExpr ¶
Augmented assignment expression like x += 5.
func (*AugAssignExpr) String ¶
func (e *AugAssignExpr) String() string
type BinaryExpr ¶
Binary expression like 1 + 2.
func (*BinaryExpr) String ¶
func (e *BinaryExpr) String() string
type CallExpr ¶
type CallExpr struct { Func Token Args []Expr }
Builtin function call like length($1).
type ContinueStmt ¶
type ContinueStmt struct{}
Continue statement.
func (*ContinueStmt) String ¶
func (s *ContinueStmt) String() string
type DeleteStmt ¶
Delete statement like delete a[k].
func (*DeleteStmt) String ¶
func (s *DeleteStmt) String() string
type DoWhileStmt ¶
Do-while loop.
func (*DoWhileStmt) String ¶
func (s *DoWhileStmt) String() string
type Expr ¶
type Expr interface { String() string // contains filtered or unexported methods }
Expr is the abstract syntax tree for any AWK expression.
type ExprStmt ¶
type ExprStmt struct {
Expr Expr
}
Expression statement like a bare function call: my_func(x).
type GetlineExpr ¶
Getline expression (read from file or pipe input).
func (*GetlineExpr) String ¶
func (e *GetlineExpr) String() string
type MultiExpr ¶
type MultiExpr struct {
Exprs []Expr
}
MultiExpr isn't an interpretable expression, but it's used as a pseudo-expression for print[f] parsing.
type PrintfStmt ¶
Printf statement like printf "%3d", 1234.
func (*PrintfStmt) String ¶
func (s *PrintfStmt) String() string
type RegExpr ¶
type RegExpr struct {
Regex string
}
Stand-alone regex expression, equivalent to: $0 ~ /regex/.
type ReturnStmt ¶
type ReturnStmt struct {
Value Expr
}
Return statement.
func (*ReturnStmt) String ¶
func (s *ReturnStmt) String() string
type Stmt ¶
type Stmt interface { String() string // contains filtered or unexported methods }
Stmt is the abstract syntax tree for any AWK statement.
type UserCallExpr ¶
type UserCallExpr struct { Native bool // false = AWK-defined function, true = native Go func Index int Name string Args []Expr }
User-defined function call like my_func(1, 2, 3). Index is the resolved function index used by the interpreter; Name is the original name used by String().
func (*UserCallExpr) String ¶
func (e *UserCallExpr) String() string