-
Notifications
You must be signed in to change notification settings - Fork 0
/
HlslToken.java
104 lines (83 loc) · 1.95 KB
/
HlslToken.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package com.destranix.glslang;
public class HlslToken extends PointerBoundObject {
private final int constructorIndex;
public HlslToken() {
this.constructorIndex = 0;
load();
}
protected HlslToken(byte[] ptr) {
this.ptr = ptr;
this.constructorIndex = -1;
}
@Override
protected void load_intern() {
if (ptr == null) {
switch (constructorIndex) {
case -1:
throw new IllegalStateException(EXCEPTION_MSG_NOT_LOADABLE);
case 0:
ptr = Main.HlslToken();
break;
default:
throw new AssertionError("Reached unreachable state!");
}
}
}
@Override
protected void free_intern() {
if (ptr != null) {
switch (constructorIndex) {
case -1:
throw new IllegalStateException(EXCEPTION_MSG_NOT_FREEABLE);
case 0:
Main.delete(ptr);
ptr = null;
break;
default:
throw new AssertionError("Reached unreachable state!");
}
}
}
public void setLoc(TSourceLoc loc) {
Main.HlslToken_setLoc(ptr, loc.getPtr());
}
public void setTokenClass(EHlslTokenClass tokenClass) {
Main.HlslToken_setTokenClass(ptr, tokenClass);
}
public void setString(String string) {
Main.HlslToken_setString(ptr, string);
}
public void setI(int i) {
Main.HlslToken_setI(ptr, i);
}
public void setU(long u) {
Main.HlslToken_setU(ptr, u);
}
public void setB(boolean b) {
Main.HlslToken_setB(ptr, b);
}
public void setD(double d) {
Main.HlslToken_setD(ptr, d);
}
public TSourceLoc getLoc() {
return fromPtr(Main.HlslToken_getLoc(ptr), TSourceLoc.class);
}
public EHlslTokenClass getTokenClass() {
return EHlslTokenClass.valueByConstant(Main.HlslToken_getTokenClass(ptr));
}
public String getString() {
return Main.HlslToken_getString(ptr);
}
public int getI() {
return Main.HlslToken_getI(ptr);
}
public long getU() {
return Main.HlslToken_getU(ptr);
}
public boolean getB() {
return Main.HlslToken_getB(ptr);
}
public double getD() {
return Main.HlslToken_getD(ptr);
}
}