1 package org.glassbox.dotparser;
2
3 public class ASTattr_stmt extends SimpleNode {
4 private static final String GRAPH = "graph";
5 private static final String NODE = "node";
6 private static final String EDGE = "edge";
7
8 private String _type;
9
10 public ASTattr_stmt(int id) {
11 super(id);
12 }
13
14 public ASTattr_stmt(DOTParser p, int id) {
15 super(p, id);
16 }
17
18 protected void setType(String type) {
19 _type = type;
20 }
21
22 public boolean isGraphStatement() {
23 return GRAPH.equalsIgnoreCase(_type);
24 }
25
26 public boolean isNodeStatement() {
27 return NODE.equalsIgnoreCase(_type);
28 }
29
30 public boolean isEdgeStatement() {
31 return EDGE.equalsIgnoreCase(_type);
32 }
33
34 public String toString() {
35 return "attr_stmt: "+_type;
36 }
37
38 /*** Accept the visitor. **/
39 public Object jjtAccept(DOTParserVisitor visitor, Object data) {
40 return visitor.visit(this, data);
41 }
42 }