Class CppCommentState
java.lang.Object
org.pipservices3.expressions.tokenizers.generic.GenericCommentState
org.pipservices3.expressions.tokenizers.generic.CppCommentState
- All Implemented Interfaces:
ICommentState
,ITokenizerState
- Direct Known Subclasses:
CCommentState
This state will either delegate to a comment-handling state, or return a token with just a slash in it.
-
Field Summary
FieldsFields inherited from class org.pipservices3.expressions.tokenizers.generic.GenericCommentState
CR, LF
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
getMultiLineComment
(IScanner scanner) Ignore everything up to a closing star and slash, and then return the tokenizer's next token.protected String
getSingleLineComment
(IScanner scanner) Ignore everything up to an end-of-line and return the tokenizer's next token.nextToken
(IScanner scanner, ITokenizer tokenizer) Either delegate to a comment-handling state, or return a token with just a slash in it.
-
Field Details
-
STAR
protected final int STAR- See Also:
-
SLASH
protected final int SLASH- See Also:
-
-
Constructor Details
-
CppCommentState
public CppCommentState()
-
-
Method Details
-
getMultiLineComment
Ignore everything up to a closing star and slash, and then return the tokenizer's next token.- Parameters:
scanner
-- Returns:
-
getSingleLineComment
Ignore everything up to an end-of-line and return the tokenizer's next token.- Parameters:
scanner
-
-
nextToken
Either delegate to a comment-handling state, or return a token with just a slash in it.- Specified by:
nextToken
in interfaceITokenizerState
- Overrides:
nextToken
in classGenericCommentState
- Parameters:
scanner
- A textual string to be tokenized.tokenizer
- A tokenizer class that controls the process.- Returns:
- The next token from the top of the stream.
- Throws:
Exception
-