Class MultiLineMatcher
- java.lang.Object
-
- com.singularsys.jep.configurableparser.matchers.MultiLineMatcher
-
- All Implemented Interfaces:
TokenMatcher
,java.io.Serializable
public class MultiLineMatcher extends java.lang.Object implements TokenMatcher
Matches tokens which span multiple lines of the input. The tokenizer matches the input a line at a time and subclasses of this can be used match tokens which span multiple lines.- See Also:
MultiLineToken
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MultiLineMatcher(TokenMatcher startMatcher, TokenMatcher endMatcher, TokenBuilder completeMatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
init(Jep j)
Initialize the matcher when the Jep instance is known.Token
match(java.lang.String s)
Match the start of the token.
-
-
-
Constructor Detail
-
MultiLineMatcher
public MultiLineMatcher(TokenMatcher startMatcher, TokenMatcher endMatcher, TokenBuilder completeMatcher)
- Parameters:
startMatcher
- a matcher to match the start of the token.endMatcher
- a matcher to match the end of the token.completeMatcher
- a TokenBuilder which is used to produce the final token.
-
-
Method Detail
-
match
public Token match(java.lang.String s) throws ParseException
Match the start of the token.- Specified by:
match
in interfaceTokenMatcher
- Parameters:
s
- the string to match against- Returns:
- a
MultiLineToken
- Throws:
ParseException
- on syntax error
-
init
public void init(Jep j)
Description copied from interface:TokenMatcher
Initialize the matcher when the Jep instance is known.- Specified by:
init
in interfaceTokenMatcher
- Parameters:
j
- Jep instance
-
-