/src/org/ooc/frontend/model/StringLiteral.java
http://github.com/nddrylliog/ooc · Java · 48 lines · 35 code · 13 blank · 0 comment · 0 complexity · 689007dff5646930b80b07447b24cef4 MD5 · raw file
- package org.ooc.frontend.model;
- import java.io.IOException;
- import org.ooc.frontend.Visitor;
- import org.ooc.frontend.model.tokens.Token;
- public class StringLiteral extends Literal {
- protected String value;
- public static Type type = new Type("String", Token.defaultToken);
-
- public StringLiteral(String value, Token startToken) {
- super(startToken);
- this.value = value;
- }
-
- public Type getType() {
- return type;
- }
-
- public String getValue() {
- return value;
- }
-
- public void accept(Visitor visitor) throws IOException {
- visitor.visit(this);
- }
-
- public boolean hasChildren() {
- return true;
- }
-
- public void acceptChildren(Visitor visitor) throws IOException {
- type.accept(visitor);
- }
-
- @Override
- public boolean replace(Node oldie, Node kiddo) {
- return false;
- }
-
- @Override
- public String toString() {
- return "\""+value+"\"";
- }
- }