nsbaci 1.0
Loading...
Searching...
No Matches
nsbaci::compiler Namespace Reference

Compiler namespace containing all compilation-related stuff. More...

Classes

struct  CompilerResult
 Result of a compilation operation. More...
class  Compiler
 Abstract base class for all compilers. More...
struct  Instruction
 Represents a single instruction in the virtual machine. More...
class  Lexer
 Flex-based lexer for BACI source code. More...
class  NsbaciCompiler
 nsbaci compiler implementation using flex and bison. More...

Typedefs

using Operand
 Operand types that an instruction can have.
using InstructionStream = std::vector<Instruction>
 Vector of instructions representing a compiled program.

Enumerations

enum class  Opcode : uint8_t {
  LoadValue , LoadAddress , LoadIndirect , StoreIndirect ,
  LoadBlock , Store , StoreKeep , PushLiteral ,
  Swap , RotateDown3 , Index , CopyBlock ,
  ValueAt , MarkStack , UpdateDisplay , Add ,
  Sub , Mult , Div , Mod ,
  Negate , Complement , And , Or ,
  TestEQ , TestNE , TestLT , TestLE ,
  TestGT , TestGE , TestEqualKeep , Jump ,
  JumpZero , Call , ShortCall , ShortReturn ,
  ExitProc , ExitFunction , EnterFrame , LeaveFrame ,
  Halt , BeginFor , EndFor , Cobegin ,
  Coend , Create , ThreadEnd , Suspend ,
  Revive , WhichProc , Wait , Signal ,
  StoreSemaphore , EnterMonitor , ExitMonitor , CallMonitorInit ,
  ReturnMonitorInit , WaitCondition , SignalCondition , Empty ,
  Read , Readln , Write , Writeln ,
  WriteString , WriteRawString , EolEof , Sprintf ,
  Sscanf , CopyString , CopyRawString , ConcatString ,
  ConcatRawString , CompareString , CompareRawString , LengthString ,
  DrawClear , DrawRefresh , DrawSetColor , DrawSetColorAlpha ,
  DrawSetLineWidth , DrawSetPosition , DrawCircle , DrawRectangle ,
  DrawTriangle , DrawLine , DrawEllipse , DrawPixel ,
  DrawText , FillCircle , FillRectangle , FillTriangle ,
  FillEllipse , MoveTo , MoveBy , ChangeColor ,
  MakeVisible , Remove , Random , Test ,
  _Count
}
 Opcodes for the BACI virtual machine instruction set.

Functions

const char * opcodeName (Opcode op)
 Get the string name of an opcode (for debugging/display).

Detailed Description

Compiler namespace containing all compilation-related stuff.

Compiler namespace for nsbaci.

Typedef Documentation

◆ Operand

Initial value:
std::variant<std::monostate,
int32_t,
uint32_t,
std::string
>

Operand types that an instruction can have.

Function Documentation

◆ opcodeName()

const char * nsbaci::compiler::opcodeName ( Opcode op)

Get the string name of an opcode (for debugging/display).

Parameters
opThe opcode to convert.
Returns
String representation of the opcode.
Here is the caller graph for this function: