001package gudusoft.gsqlparser.nodes.powerquery;
002
003import gudusoft.gsqlparser.nodes.TParseTreeNode;
004import gudusoft.gsqlparser.nodes.TParseTreeVisitor;
005
006/**
007 * Literal value (string, number, bool, null) used as an M expression leaf.
008 *
009 * <p>String literals preserve both raw form (round-trip) and decoded form
010 * (semantic value after {@code ""} / {@code #(lf)} / {@code #(XXXX)} escapes).
011 */
012public class TPowerQueryLiteral extends TParseTreeNode {
013
014    public enum Kind { STRING, INTEGER, FLOAT, BOOLEAN, NULL }
015
016    private Kind kind;
017    private String rawText;
018    private String decodedValue;
019
020    public Kind getKind() {
021        return kind;
022    }
023
024    public void setKind(Kind kind) {
025        this.kind = kind;
026    }
027
028    public String getRawText() {
029        return rawText;
030    }
031
032    public void setRawText(String rawText) {
033        this.rawText = rawText;
034    }
035
036    public String getDecodedValue() {
037        return decodedValue;
038    }
039
040    public void setDecodedValue(String decodedValue) {
041        this.decodedValue = decodedValue;
042    }
043
044    @Override
045    public void accept(TParseTreeVisitor v) {
046        v.preVisit(this);
047        v.postVisit(this);
048    }
049
050    @Override
051    public void acceptChildren(TParseTreeVisitor v) {
052        v.preVisit(this);
053        v.postVisit(this);
054    }
055}