Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/GuardExpression.java @ 18761:a665483c3881
Truffle-DSL: new node layout implementation.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 29 Dec 2014 23:38:54 +0100 |
parents | c88ab4f1f04a |
children | 08aa0372dad4 |
rev | line source |
---|---|
16766
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
1 /* |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
2 * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved. |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
4 * |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
7 * published by the Free Software Foundation. |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
8 * |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
13 * accompanied this code). |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
14 * |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
18 * |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
21 * questions. |
90984ae0eaa8
Truffle-DSL: Fixed headers.
Christian Humer <christian.humer@gmail.com>
parents:
16763
diff
changeset
|
22 */ |
16763
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
23 package com.oracle.truffle.dsl.processor.model; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
24 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
25 import java.util.*; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
26 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
27 public final class GuardExpression { |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
28 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
29 private GuardData resolvedGuard; |
16851
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
30 private NodeExecutionData[] resolvedChildren; |
16763
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
31 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
32 private final String guardName; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
33 private final boolean negated; |
16851
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
34 private final String[] childNames; |
16763
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
35 |
16851
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
36 public GuardExpression(String expression, boolean allowArguments) { |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
37 String exp = expression; |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
38 if (exp.startsWith("!")) { |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
39 exp = exp.substring(1, exp.length()); |
16763
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
40 negated = true; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
41 } else { |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
42 negated = false; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
43 } |
16851
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
44 |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
45 int argumentStart = exp.indexOf('('); |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
46 int endIndex = exp.lastIndexOf(')'); |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
47 if (allowArguments && argumentStart != -1 && endIndex != -1) { |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
48 guardName = exp.substring(0, argumentStart).trim(); |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
49 String arguments = exp.substring(argumentStart + 1, endIndex); |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
50 String[] children = arguments.split(","); |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
51 for (int i = 0; i < children.length; i++) { |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
52 children[i] = children[i].trim(); |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
53 } |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
54 if (children.length == 1 && children[0].isEmpty()) { |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
55 childNames = new String[0]; |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
56 } else { |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
57 childNames = children; |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
58 } |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
59 } else { |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
60 guardName = exp; |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
61 childNames = null; |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
62 } |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
63 } |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
64 |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
65 public String[] getChildNames() { |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
66 return childNames; |
16763
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
67 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
68 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
69 public boolean isResolved() { |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
70 return resolvedGuard != null; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
71 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
72 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
73 public String getGuardName() { |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
74 return guardName; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
75 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
76 |
16851
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
77 public NodeExecutionData[] getResolvedChildren() { |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
78 return resolvedChildren; |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
79 } |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
80 |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
81 public void setResolvedChildren(NodeExecutionData[] resolvedChildren) { |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
82 this.resolvedChildren = resolvedChildren; |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
83 } |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
84 |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
85 public void setResolvedGuard(GuardData guard) { |
16763
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
86 this.resolvedGuard = guard; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
87 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
88 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
89 @Override |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
90 public boolean equals(Object obj) { |
16851
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
91 if (this == obj) { |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
92 return true; |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
93 } else if (obj instanceof GuardExpression) { |
16763
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
94 GuardExpression other = (GuardExpression) obj; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
95 if (isResolved() && other.isResolved()) { |
16851
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
96 return resolvedGuard.equals(other.resolvedGuard) && negated == other.negated && Arrays.equals(resolvedChildren, other.resolvedChildren); |
16763
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
97 } else { |
16851
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
98 boolean equal = guardName.equals(other.guardName) && negated == other.negated; |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
99 if (childNames != null && other.childNames != null) { |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
100 equal &= Arrays.equals(childNames, other.childNames); |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
101 } |
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
102 return equal; |
16763
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
103 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
104 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
105 return false; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
106 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
107 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
108 @Override |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
109 public int hashCode() { |
16851
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
110 return Objects.hash(guardName, negated, resolvedGuard, resolvedChildren); |
16763
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
111 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
112 |
18163
c88ab4f1f04a
re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents:
16851
diff
changeset
|
113 public boolean implies(GuardExpression other) { |
16851
2db61eddcb97
Truffle-DSL: argument syntax support for guards
Christian Humer <christian.humer@gmail.com>
parents:
16766
diff
changeset
|
114 if (equals(other)) { |
16763
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
115 return true; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
116 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
117 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
118 if (isResolved() && other.isResolved()) { |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
119 for (GuardExpression implies : getResolvedGuard().getImpliesExpressions()) { |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
120 if (implies.getGuardName().equals(other.getGuardName())) { |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
121 if (implies.isNegated() == other.isNegated()) { |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
122 return true; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
123 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
124 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
125 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
126 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
127 return false; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
128 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
129 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
130 @Override |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
131 public String toString() { |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
132 return (negated ? "!" : "") + guardName; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
133 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
134 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
135 public boolean isNegated() { |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
136 return negated; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
137 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
138 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
139 public GuardData getResolvedGuard() { |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
140 return resolvedGuard; |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
141 } |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
142 |
e6d15134ca86
Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents:
16759
diff
changeset
|
143 } |