Package com._1c.g5.v8.dt.bsl.qw.utils
Class Parser
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.qw.utils.Parser
-
public class Parser extends Object
BSL modules parser for query wizard 1. Find text by means of findTextPosition 2. Build tokens sequence 3. Parse 4. In parse result find required tokens
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Parser.TextPosition
Store position in node textstatic class
Parser.TokensSequence
Parsing template
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Parser.TextPosition
findTextPosition(Module module, int offset, String tagStart, String tagStartRu, String tagEnd, String tagEndRu)
Find text position in modulestatic Parser.TextPosition
findTextPosition(Module module, String tagStart, String tagStartRu, String tagEnd, String tagEndRu)
Find text positionstatic Parser.TextPosition
findTextPosition(String text, String tagStart, String tagStartRu, String tagEnd, String tagEndRu)
Find text positionstatic Map<String,Parser.TokensSequence>
parse(Parser.TextPosition textPosition, Map<String,Parser.TokensSequence> tokensSequence)
Parse node text
-
-
-
Method Detail
-
findTextPosition
public static Parser.TextPosition findTextPosition(Module module, int offset, String tagStart, String tagStartRu, String tagEnd, String tagEndRu)
Find text position in module- Parameters:
module
- - module with textoffset
- - start offsettagStart
- - start tag for searchingtagStartRu
- - russian start tag for searchingtagEnd
- - end tag for searchingtagEndRu
- - russian end tag for searching- Returns:
- text position if text found or null
-
findTextPosition
public static Parser.TextPosition findTextPosition(Module module, String tagStart, String tagStartRu, String tagEnd, String tagEndRu)
Find text position- Parameters:
module
- - moduletagStart
- - start tagtagStartRu
- - start russian tagtagEnd
- - end tagtagEndRu
- - end russian text- Returns:
- text position
-
findTextPosition
public static Parser.TextPosition findTextPosition(String text, String tagStart, String tagStartRu, String tagEnd, String tagEndRu)
Find text position- Parameters:
text
- - texttagStart
- - start tagtagStartRu
- - start russian tagtagEnd
- - end tagtagEndRu
- - end russian text- Returns:
- text position
-
parse
public static Map<String,Parser.TokensSequence> parse(Parser.TextPosition textPosition, Map<String,Parser.TokensSequence> tokensSequence)
Parse node text- Parameters:
textPosition
- - node with text, and text start and end offsetstokensSequence
- - tokens sequence for search- Returns:
- found tokens
-
-