Class CommentTokenMatcher
java.lang.Object
com.singularsys.jep.configurableparser.matchers.RegExpTokenMatcher
com.singularsys.jep.configurableparser.matchers.CommentTokenMatcher
- All Implemented Interfaces:
TokenBuilder,TokenMatcher,Serializable
Matches various styles of comments.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildToken(String s) Builds a token following a successful match.static CommentTokenMatcherRecognise comments of the form # ...voidInitialize the matcher when the Jep instance is known.static MultiLineMatcherRecognise comments of the form /* ... */ which can span multiple lines.static CommentTokenMatcherRecognise comments of the form // ...static CommentTokenMatcherRecognise comments of the form /* ... */ on a single line.Methods inherited from class com.singularsys.jep.configurableparser.matchers.RegExpTokenMatcher
match
-
Constructor Details
-
CommentTokenMatcher
-
CommentTokenMatcher
-
-
Method Details
-
buildToken
Description copied from class:RegExpTokenMatcherBuilds a token following a successful match. Note new objects should be created each time as error reporting information is later attached to tokens.- Specified by:
buildTokenin interfaceTokenBuilder- Specified by:
buildTokenin classRegExpTokenMatcher- Parameters:
s- String representing the completed matched token- Returns:
- the appropriate type of token.
-
slashStarCommentMatcher
Recognise comments of the form /* ... */ on a single line.- Returns:
- a TokenMatcher
-
multiLineSlashStarCommentMatcher
Recognise comments of the form /* ... */ which can span multiple lines.- Returns:
- a TokenMatcher
-
slashSlashCommentMatcher
Recognise comments of the form // ...- Returns:
- a TokenMatcher
-
hashCommentMatcher
Recognise comments of the form # ...- Returns:
- a TokenMatcher
-
init
Description copied from interface:TokenMatcherInitialize the matcher when the Jep instance is known.- Parameters:
j- Jep instance
-