Class Symbol

    • Constructor Detail

      • Symbol

        public Symbol()
        Create a symbol with no attributes.
      • Symbol

        public Symbol​(java.util.Collection<ParserAttribute> attributes)
        Create a symbol with an initial set of attributes.
        Parameters:
        attributes - the attributes
        Throws:
        GrammarException - if the attribute names are not unique
        AttributeException - if an attribute has an invalid value
    • Method Detail

      • matches

        public abstract boolean matches​(Token input)
        Does this symbol match the specified token?

        This is very like equality, but consider that for some kinds of symbols (for example, tokens that match regular expressions) it isn't really the same as equality.

        Parameters:
        input - The token.
        Returns:
        true if the token matches.
      • matches

        public abstract boolean matches​(Symbol input)
        Does this symbol match the specified symbol?
        Parameters:
        input - The symbol.
        Returns:
        true if it is the same symbol as this symbol.
      • export

        public abstract void export​(GrammarExporter exporter)
        Export this symbol with the specified exporter.
        Parameters:
        exporter - the exporter.