type Input … // NewInput returns an Input from the given path. func NewInput(name string) *Input { … } // predefine installs the macros set by the -D flag on the command line. func predefine(defines flags.MultiFlag) map[string]*Macro { … } var panicOnError … func (in *Input) Error(args ...interface{ … } // expectText is like Error but adds "got XXX" where XXX is a quoted representation of the most recent token. func (in *Input) expectText(args ...interface{ … } // enabled reports whether the input is enabled by an ifdef, or is at the top level. func (in *Input) enabled() bool { … } func (in *Input) expectNewline(directive string) { … } func (in *Input) Next() ScanToken { … } func (in *Input) Text() string { … } // hash processes a # preprocessor directive. It reports whether it completes. func (in *Input) hash() bool { … } // macroName returns the name for the macro being referenced. func (in *Input) macroName() string { … } // #define processing. func (in *Input) define() { … } // defineMacro stores the macro definition in the Input. func (in *Input) defineMacro(name string, args []string, tokens []Token) { … } // macroDefinition returns the list of formals and the tokens of the definition. // The argument list is nil for no parens on the definition; otherwise a list of // formal argument names. func (in *Input) macroDefinition(name string) ([]string, []Token) { … } // invokeMacro pushes onto the input Stack a Slice that holds the macro definition with the actual // parameters substituted for the formals. // Invoking a macro does not touch the PC/line history. func (in *Input) invokeMacro(macro *Macro) { … } // argsFor returns a map from formal name to actual value for this argumented macro invocation. // The opening parenthesis has been absorbed. func (in *Input) argsFor(macro *Macro) map[string][]Token { … } // collectArgument returns the actual tokens for a single argument of a macro. // It also returns the token that terminated the argument, which will always // be either ',' or ')'. The starting '(' has been scanned. func (in *Input) collectArgument(macro *Macro) ([]Token, ScanToken) { … } // #ifdef and #ifndef processing. func (in *Input) ifdef(truth bool) { … } // #else processing func (in *Input) else_() { … } // #endif processing. func (in *Input) endif() { … } // #include processing. func (in *Input) include() { … } // #line processing. func (in *Input) line() { … } // #undef processing func (in *Input) undef() { … } func (in *Input) Push(r TokenReader) { … } func (in *Input) Close() { … }