package util;

import java.util.*;

public final class Characters {

    private Characters() {}

    public static final int EOF = -1;

    public static final char BACKSLASH = '\\';
    public static final char DOUBLE_QUOTE = '\"';
    public static final char HASH = '#';
    public static final char LEFT_PARENTHESIS = '(';
    public static final char LEFT_SQUARE_BRACKET = '[';
    public static final char NEWLINE = '\n';
    public static final char PERIOD = '.';
    public static final char RIGHT_PARENTHESIS = ')';
    public static final char RIGHT_SQUARE_BRACKET = ']';
    public static final char SEMICOLON = ';';
    public static final char SINGLE_QUOTE = '\'';
    public static final char TICK_MARK = '`';

    public static final Set<Character> illegalIdentifierCharacters = new HashSet<>();

    static {
        illegalIdentifierCharacters.add(DOUBLE_QUOTE);
        illegalIdentifierCharacters.add(SINGLE_QUOTE);
        illegalIdentifierCharacters.add(BACKSLASH);
        illegalIdentifierCharacters.add(TICK_MARK);
        illegalIdentifierCharacters.add(LEFT_PARENTHESIS);
        illegalIdentifierCharacters.add(RIGHT_PARENTHESIS);
        illegalIdentifierCharacters.add(LEFT_SQUARE_BRACKET);
        illegalIdentifierCharacters.add(RIGHT_SQUARE_BRACKET);
        illegalIdentifierCharacters.add(HASH);
        illegalIdentifierCharacters.add(PERIOD);
        illegalIdentifierCharacters.add(SEMICOLON);
    }

    public static boolean isLegalIdentifierCharacter(char c) {
        return (!Character.isWhitespace(c)) && (!illegalIdentifierCharacters.contains(c));
    }

    public static boolean isLegalStringCharacter(char c) {
        return true;
    }

}
