Package com._1c.g5.v8.dt.bsl.qw.utils
Class Parser.TokensSequence
java.lang.Object
com._1c.g5.v8.dt.bsl.qw.utils.Parser.TokensSequence
- Enclosing class:
- Parser
Parsing template
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLook only textSearch by type nameSearch text and check typeSearch text and check typevoid
apply
(org.eclipse.xtext.nodemodel.INode node, org.eclipse.emf.ecore.EObject object) Apply node to parsing templateGet found resultint
Get found result offset in textboolean
If found sequence matched with pattern
-
Constructor Details
-
TokensSequence
public TokensSequence()
-
-
Method Details
-
add
Look only text- Parameters:
text
- - text for search- Returns:
- this
-
add
Search by type name- Parameters:
typeItemNameOrText
- - type name or textisTypeName
- - search in type name if true or in text if false- Returns:
- this
-
add
Search text and check type- Parameters:
text
- - texttextRu
- - Russian texttype
- - found token type- Returns:
- this
-
add
public Parser.TokensSequence add(String text, String textRu, Class<? extends Object> type, boolean markAsResult) Search text and check type- Parameters:
text
- - texttextRu
- - Russian texttype
- - found token typemarkAsResult
- - use found token as result- Returns:
- this
-
apply
public void apply(org.eclipse.xtext.nodemodel.INode node, org.eclipse.emf.ecore.EObject object) Apply node to parsing template- Parameters:
node
- - nodeobject
- - associated object with node
-
isHaveResult
public boolean isHaveResult()If found sequence matched with pattern- Returns:
- true if found
-
getResult
Get found result- Returns:
- found result
-
getResultOffset
public int getResultOffset()Get found result offset in text- Returns:
- offset or -1 if result not found
-