Class TextConstParser

java.lang.Object
xyz.cofe.text.lex.TextConstParser
All Implemented Interfaces:
TokenParser

public class TextConstParser
extends java.lang.Object
implements TokenParser
Парсер текстовой константы
 text ::= doubleQuote { escapeText | anyChar } doubleQuote
        | singleQuote { escapeText | anyChar } singleQuote

 doubleQuote ::= "
 singleQuote ::= '
 escapeChar  ::= \
 escapeText  ::= escapeChar
                 ( escapeChar
                 | singleQuote
                 | doubleQuote
                 | n
                 | r
                 | t
                 | b
                 | f
                 | u hexDigit
                 )
 hexDigit ::= 0..9
            | a..f
            | A..F
 
Author:
gocha
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.lang.String id  
  • Constructor Summary

    Constructors 
    Constructor Description
    TextConstParser()  
    TextConstParser​(java.lang.String id)  
  • Method Summary

    Modifier and Type Method Description
    TextConst parse​(java.lang.String source, int offset)
    Возвращает токен если ему соответ цепочка сиволов в указаной точке

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • id

      protected java.lang.String id
  • Constructor Details

  • Method Details

    • parse

      public TextConst parse​(java.lang.String source, int offset)
      Description copied from interface: TokenParser
      Возвращает токен если ему соответ цепочка сиволов в указаной точке
      Specified by:
      parse in interface TokenParser
      Parameters:
      source - Цепочка символов
      offset - Смещение от начала цепочки символов
      Returns:
      Токен или null, если нет совпадения