Documentation ¶
Overview ¶
A set of parser rules for C-Like syntax.
Index ¶
- Constants
- Variables
- func C_DeclFragment_Func(p *parser.Parser, tokens *scanlist.Element, left interface{}) parser.ParserResult
- func RegisterDeclaration(p *parser.Parser)
- func RegisterExpr(p *parser.Parser)
- func RegisterExprCast(p *parser.Parser)
- func RegisterStatememt(p *parser.Parser)
- func RegisterType(p *parser.Parser)
- type DType
- type DeclCType
- type DeclImplFunc
- type DeclInclude
- type DeclNone
- type DeclProtoFunc
- type Expr
- type ParamDecl
- type Statement
- type VarDecl
Constants ¶
View Source
const ( E_VAR E_INT E_FLOAT E_CHAR E_STRING E_INCR E_DECR E_FIELD_DOT // Expr.Field E_FIELD_PTR // Expr->Field E_UNARY_OP E_BINARY_OP E_BINARY_OP_ASSIGN E_COMPARE E_ASSIGN E_FUNCTION_CALL // Expr( [Expr [,Expr]* ] ) E_CONDITIONAL E_CAST E_INDEX )
View Source
const ( C_IF = rune(-(100 + iota)) C_ELSE C_DO C_WHILE C_FOR C_CONST )
View Source
const ( S_EXPR S_BLOCK S_VARDEC S_FOR S_IF S_IF_ELSE S_DO_WHILE S_WHILE )
View Source
const ( T_NAME // Identifiers like "int", "float" or "string" etc... T_CONST // Constant value T_PTR // Pointer )
Variables ¶
Functions ¶
func C_DeclFragment_Func ¶
func RegisterDeclaration ¶
func RegisterExpr ¶
The following expression classes are registered.
'Expr0' // Primary Expression + Suffix 'Expr1' // Unary Expression 'Expr2' // Cast Expression 'Expr3' // Multiplicative Expression 'Expr4' // Additive Expression 'Expr5' // Bitwise expression 'Expr6' // Relational expression 'Expr7' // Logical expression 'Expr8' // Conditional expression 'Expr' // Expression
func RegisterExprCast ¶
Should be called only after RegisterExpr()! Adds the casting operation (Type)Expr.
func RegisterStatememt ¶
func RegisterType ¶
Types ¶
type DeclImplFunc ¶
type DeclInclude ¶
type DeclInclude struct {
HdrName string
}
func (*DeclInclude) String ¶
func (d *DeclInclude) String() string
type DeclProtoFunc ¶
Click to show internal directories.
Click to hide internal directories.