Lumenarium/src/app/assembly_parser.h

76 lines
1.4 KiB
C
Raw Normal View History

2020-01-02 02:41:43 +00:00
//
// File: assembly_parser.h
// Author: Peter Slattery
// Creation Date: 2020-01-01
//
#ifndef ASSEMBLY_PARSER_H
2019-07-19 20:56:21 +00:00
#define LED_STRIP_COUNT_IDENTIFIER "led_strip_count"
#define LED_STRIP_IDENTIFIER "led_strip"
#define INTERPOLATE_POINTS_IDENTIFIER "INTERPOLATE_POINTS"
#define END_ASSEMBLY_FILE_IDENTIFIER "END_OF_ASSEMBLY_FILE"
enum assembly_token_type
{
AssemblyToken_Colon,
AssemblyToken_SemiColon,
AssemblyToken_LeftCurlyBrace,
AssemblyToken_RightCurlyBrace,
AssemblyToken_Comma,
AssemblyToken_Number,
AssemblyToken_String,
AssemblyToken_Vector,
AssemblyToken_LEDStrip,
AssemblyToken_Identifier,
AssemblyToken_EndOfFile
};
struct assembly_token
{
char* Token;
s32 Length;
assembly_token_type Type;
};
enum strip_interpolation_type
{
StripInterpolate_Boxes,
StripInterpolate_Points,
};
struct led_strip_definition
{
2020-01-14 01:04:40 +00:00
u32 ControlBoxID;
u32 StartUniverse;
u32 StartChannel;
2019-07-19 20:56:21 +00:00
strip_interpolation_type InterpolationType;
// Interpolate Boxes
2020-01-14 01:04:40 +00:00
u32 StartBoxIndex;
u32 EndBoxIndex;
2019-07-19 20:56:21 +00:00
// Interpolate Positions
2020-01-14 01:04:40 +00:00
v3 InterpolatePositionStart;
v3 InterpolatePositionEnd;
2019-07-19 20:56:21 +00:00
// Universal Interpolation
2020-01-14 01:04:40 +00:00
u32 LEDsPerStrip;
2019-07-19 20:56:21 +00:00
};
struct assembly_definition
{
2020-01-14 01:04:40 +00:00
u32 LEDStripSize;
u32 LEDStripCount;
u32 TotalLEDCount;
2019-07-19 20:56:21 +00:00
led_strip_definition* LEDStrips;
2020-01-02 02:41:43 +00:00
};
#define ASSEMBLY_PARSER_H
#endif // ASSEMBLY_PARSER_H