90 #include <unordered_map>
92 #include "../submodules/CoreLibrary/CoreLibrary/types.h"
114 uint8 members_to_go_;
115 uint8 timestamp_data_;
116 uint8 duration_data_;
122 void write_indents(std::ostream& out);
147 DEVICE_FUNCTION = 0xA2,
157 INSTANTIATED_PROGRAM = 0xC9,
158 INSTANTIATED_CPP_PROGRAM = 0xCA,
159 INSTANTIATED_INPUT_LESS_PROGRAM = 0xCB,
160 INSTANTIATED_ANTI_PROGRAM = 0xCC,
161 COMPOSITE_STATE = 0xCD,
168 static Atom Float(float32 f);
169 static Atom PlusInfinity();
170 static Atom MinusInfinity();
171 static Atom UndefinedFloat();
173 static Atom Boolean(
bool value);
174 static Atom UndefinedBoolean();
175 static Atom Wildcard(uint16 opcode = 0x00);
176 static Atom TailWildcard();
177 static Atom IPointer(uint16 index);
178 static Atom VLPointer(uint16 index);
179 static Atom RPointer(uint16 index);
180 static Atom IPGMPointer(uint16 index);
181 static Atom InObjPointer(uint8 input_index, uint16 index);
182 static Atom DInObjPointer(uint8 relative_index, uint16 index);
183 static Atom OutObjPointer(uint16 index);
184 static Atom ValuePointer(uint16 index);
185 static Atom ProductionPointer(uint16 index);
186 static Atom AssignmentPointer(uint8 variable_index, uint16 index);
187 static Atom CodeVLPointer(uint16 index, uint16 cast_opcode = 0x0FFF);
192 static Atom SSet(uint16 opcode, uint8 element_count);
193 static Atom Set(uint8 element_count);
194 static Atom CPointer(uint8 element_count);
195 static Atom Object(uint16 opcode, uint8 arity);
196 static Atom Marker(uint16 opcode, uint8 arity);
197 static Atom Operator(uint16 opcode, uint8 arity);
198 static Atom Node(uint8 node_id);
199 static Atom UndefinedNode();
200 static Atom Device(uint8 node_id, uint8 class_id, uint8 dev_id);
201 static Atom UndefinedDevice();
202 static Atom DeviceFunction(uint16 opcode);
203 static Atom UndefinedDeviceFunction();
205 static Atom UndefinedString();
206 static Atom Timestamp();
207 static Atom UndefinedTimestamp();
208 static Atom Duration();
209 static Atom InstantiatedProgram(uint16 opcode, uint8 arity);
210 static Atom Group(uint16 opcode, uint8 arity);
211 static Atom InstantiatedCPPProgram(uint16 opcode, uint8 arity);
212 static Atom InstantiatedAntiProgram(uint16 opcode, uint8 arity);
213 static Atom InstantiatedInputLessProgram(uint16 opcode, uint8 arity);
214 static Atom CompositeState(uint16 opcode, uint8 arity);
215 static Atom Model(uint16 opcode, uint8 arity);
217 static Atom NullProgram(
bool take_past_inputs);
218 static Atom RawPointer(
void *pointer);
220 Atom(uint32 a = 0xFFFFFFFF);
224 bool operator ==(
const Atom& a)
const;
225 bool operator !=(
const Atom& a)
const;
226 bool operator !()
const;
227 operator size_t ()
const;
232 bool isUndefined()
const;
233 uint8 getDescriptor()
const;
234 bool isStructural()
const;
235 bool isFloat()
const;
236 bool readsAsNil()
const;
237 float32 asFloat()
const;
238 bool asBoolean()
const;
239 bool isBooleanTrue()
const;
240 bool isBooleanFalse()
const;
241 uint16 asIndex()
const;
243 uint8 asInputIndex()
const;
244 uint8 asRelativeIndex()
const;
245 uint16 asOpcode()
const;
246 uint16 asCastOpcode()
const;
247 uint8 getNodeID()
const;
248 uint8 getClassID()
const;
249 uint8 getDeviceID()
const;
250 uint8 asAssignmentIndex()
const;
251 uint8 getAtomCount()
const;
257 bool takesPastInputs()
const;
258 template<
class C> C *asRawPointer()
const {
return (C *)atom_; }
260 void trace(TraceContext& context, std::ostream& out)
const;
269 bool __declspec(dllexport) SetOpcodeNames(
const std::unordered_map<uint16, std::set<std::string>>& opcode_names);
277 std::string GetOpcodeName(uint16 opcode);
281 #include "atom.inline.cpp"