All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bidib.wizard.common.highlight.Token Maven / Gradle / Ivy

package org.bidib.wizard.common.highlight;

// Public domain, no restrictions, Ian Holyer, University of Bristol.

/**
 * A token represents a smallest meaningful fragment of text, such as a word, recognised by a scanner.
 */
public class Token {
    /**
     * The symbol contains all the properties shared with similar tokens.
     */
    public Symbol symbol;

    /**
     * The token's position is given by an index into the document text.
     */
    public int position;

    /**
     * Create a token with a given symbol and position.
     */
    Token(Symbol symbol, int position) {
        this.symbol = symbol;
        this.position = position;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy