/src/org/ooc/frontend/model/CharLiteral.java

http://github.com/nddrylliog/ooc · Java · 47 lines · 34 code · 13 blank · 0 comment · 0 complexity · d5a0feb442968a4ceab9d7e985e17a79 MD5 · raw file

  1. package org.ooc.frontend.model;
  2. import java.io.IOException;
  3. import org.ooc.frontend.Visitor;
  4. import org.ooc.frontend.model.tokens.Token;
  5. public class CharLiteral extends Literal {
  6. protected char value;
  7. public static Type type = new Type("Char", Token.defaultToken);
  8. public CharLiteral(char value, Token startToken) {
  9. super(startToken);
  10. this.value = value;
  11. }
  12. public char getValue() {
  13. return value;
  14. }
  15. public void setValue(char value) {
  16. this.value = value;
  17. }
  18. public Type getType() {
  19. return type;
  20. }
  21. public void accept(Visitor visitor) throws IOException {
  22. visitor.visit(this);
  23. }
  24. public boolean hasChildren() {
  25. return true;
  26. }
  27. public void acceptChildren(Visitor visitor) throws IOException {
  28. type.accept(visitor);
  29. }
  30. @Override
  31. public boolean replace(Node oldie, Node kiddo) {
  32. return false;
  33. }
  34. }