Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefineDirective ¶
type DefineDirective struct {
Name string `parser:" @Define EOL" `
}
func (DefineDirective) Eval ¶
func (d DefineDirective) Eval(vars PreprocVars) string
type Directive ¶
type Directive struct { Ifndef *IfndefDirective `parser:" EOL* ( @@ "` Ifdef *IfdefDirective `parser:" | @@ "` Define *DefineDirective `parser:" | @@ "` Include *IncludeDirective `parser:" | @@ "` Source string `parser:" | @Source ) "` }
func (Directive) Eval ¶
func (d Directive) Eval(vars PreprocVars) string
type IfdefDirective ¶
type IfdefDirective struct { Name string `parser:" @Ifdef EOL "` Directives []Directive `parser:" @@* '#endif' EOL "` }
func (IfdefDirective) Eval ¶
func (d IfdefDirective) Eval(vars PreprocVars) string
type IfndefDirective ¶
type IfndefDirective struct { Name string `parser:" @Ifndef EOL "` Directives []Directive `parser:" @@* '#endif' EOL "` }
func (IfndefDirective) Eval ¶
func (d IfndefDirective) Eval(vars PreprocVars) string
type IncludeDirective ¶
type IncludeDirective struct {
Name string `parser:" @Include EOL" `
}
func (IncludeDirective) Eval ¶
func (d IncludeDirective) Eval(vars PreprocVars) string
type PreprocVars ¶
type PreprocVars map[string]struct{}
type PreprocessorHeaderFileAST ¶
type PreprocessorHeaderFileAST struct {
Directives []Directive `parser:" @@* "`
}
func ParsePreprocessorString ¶
func ParsePreprocessorString(s string) (*PreprocessorHeaderFileAST, error)
func (PreprocessorHeaderFileAST) Eval ¶
func (f PreprocessorHeaderFileAST) Eval(isCpp bool) string
Click to show internal directories.
Click to hide internal directories.