Class Parser.TokensSequence

  • Enclosing class:
    Parser

    public static class Parser.TokensSequence
    extends Object
    Parsing template
    • Constructor Detail

      • TokensSequence

        public TokensSequence()
    • Method Detail

      • add

        public Parser.TokensSequence add​(String typeItemNameOrText,
                                         boolean isTypeName)
        Search by type name
        Parameters:
        typeItemNameOrText - - type name or text
        isTypeName - - search in type name if true or in text if false
        Returns:
        this
      • add

        public Parser.TokensSequence add​(String text,
                                         String textRu,
                                         Class<? extends Object> type)
        Search text and check type
        Parameters:
        text - - text
        textRu - - Russian text
        type - - 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 - - text
        textRu - - Russian text
        type - - found token type
        markAsResult - - 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 - - node
        object - - associated object with node
      • isHaveResult

        public boolean isHaveResult()
        If found sequence matched with pattern
        Returns:
        true if found
      • getResult

        public Object 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