All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
chunk.h
Go to the documentation of this file.
1 #ifndef uscript_chunk_h
2 #define uscript_chunk_h
3 
4 #include <vector>
5 #include <string>
6 #include <map>
7 
8 #include "value.h"
9 #include "common.h"
10 
11 namespace uscript {
12 
13 enum OpCode {
43 };
44 
45 class Chunk {
46 public:
47  unsigned AddConstant(Value constant);
48  void Write(uint8_t instruction);
49  void Disassemble(const std::string &name) const;
50 
51  std::string source;
52  std::vector<uint8_t> code;
53  std::vector<Value> constants;
54  unsigned DisassembleInstruction(unsigned index) const;
55 };
56 
57 } // end namespace
58 #endif
std::vector< Value > constants
Definition: chunk.h:53
void Write(uint8_t instruction)
Definition: chunk.cc:6
std::vector< uint8_t > code
Definition: chunk.h:52
OpCode
Definition: chunk.h:13
unsigned AddConstant(Value constant)
Definition: chunk.cc:10
void Disassemble(const std::string &name) const
Definition: chunk.cc:15
unsigned DisassembleInstruction(unsigned index) const
Definition: chunk.cc:47
then echo fcl name
std::string source
Definition: chunk.h:51