package org.metaborg.parsetable.symbols;

public class LiteralSymbol extends NonTerminalSymbol implements ILiteralSymbol {

    String literal;

    public LiteralSymbol(SyntaxContext syntaxContext, SortCardinality cardinality, String literal) {
        super(syntaxContext, cardinality);
        this.literal = literal;
    }

    @Override public String literal() {
        return literal;
    }

    @Override public boolean isOperator() {
        for(int i = 0; i < literal.length(); i++) {
            char c = literal.charAt(i);

            if(Character.isLetter(c))
                return false;
        }

        return true;
    }

    @Override public String descriptor() {
        return "\"" + literal + "\"";
    }

}

@@ -451,69 +451,18 @@
  for
-(int i = 0; i %3C literal.length(); i++) %7B%0A           
  
+(
 char c 
-=
+:
  lit
@@ -470,19 +470,24 @@
 ral.
-c
+toC
 harA
-t(i);%0A
+rray()) %7B
 %0A   

Refactor LiteralSymbol.isOperator