java.lang.Object
com.maroontress.clione.impl.DirectiveParseKit
Provides the feature to parse a preprocessor directive.
This class reads characters from the source specified in the constructor and parses them as preprocessor directives. The #include directive is parsed specially.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
The functional interface that accepts a list of tokens. -
Constructor Summary
ConstructorsConstructorDescriptionDirectiveParseKit
(Source source, Set<String> reservedWords) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDirectiveTokens
(List<Token> list) Adds tokens of the directive to the specified list.void
addIncludeDirectiveTokens
(List<Token> list) Adds tokens of the include directive to the specified list.void
addLineDirectiveTokens
(List<Token> list) Adds tokens of the line directive to the specified list.Returns the next token of the directive.Returns the next token of the include directive.Returns the next token of the line directive.
-
Constructor Details
-
DirectiveParseKit
Constructs a new instance.- Parameters:
source
- The source.reservedWords
- The set of reserved words.
-
-
Method Details
-
addDirectiveTokens
Adds tokens of the directive to the specified list.- Parameters:
list
- The list of tokens.- Throws:
IOException
- if an I/O error occurs.
-
addIncludeDirectiveTokens
Adds tokens of the include directive to the specified list.- Parameters:
list
- The list of tokens.- Throws:
IOException
- if an I/O error occurs.
-
addLineDirectiveTokens
Adds tokens of the line directive to the specified list.- Parameters:
list
- The list of tokens.- Throws:
IOException
- if an I/O error occurs.
-
newDirectiveChildToken
Returns the next token of the directive.- Returns:
- The next token.
- Throws:
IOException
- if an I/O error occurs.
-
newIncludeDirectiveChildToken
Returns the next token of the include directive.- Returns:
- The next token.
- Throws:
IOException
- if an I/O error occurs.
-
newLineDirectiveChildToken
Returns the next token of the line directive.- Returns:
- The next token.
- Throws:
IOException
- if an I/O error occurs.
-