Support C-Style enum in preproc (#1984)
* [preproc] C-style enums - asm files parseable from stdin - 2nd preproc pass - add parser for C-style `enum` - positional arguments at end of command --------- Co-authored-by: sbird <sbird@no.tld> Co-authored-by: Martin Griffin <martinrgriffin@gmail.com>
This commit is contained in:
@@ -31,13 +31,14 @@ enum class Directive
|
||||
Include,
|
||||
String,
|
||||
Braille,
|
||||
Enum,
|
||||
Unknown
|
||||
};
|
||||
|
||||
class AsmFile
|
||||
{
|
||||
public:
|
||||
AsmFile(std::string filename);
|
||||
AsmFile(std::string filename, bool isStdin, bool doEnum);
|
||||
AsmFile(AsmFile&& other);
|
||||
AsmFile(const AsmFile&) = delete;
|
||||
~AsmFile();
|
||||
@@ -49,9 +50,11 @@ public:
|
||||
bool IsAtEnd();
|
||||
void OutputLine();
|
||||
void OutputLocation();
|
||||
bool ParseEnum();
|
||||
|
||||
private:
|
||||
char* m_buffer;
|
||||
bool m_doEnum;
|
||||
long m_pos;
|
||||
long m_size;
|
||||
long m_lineNum;
|
||||
@@ -68,6 +71,10 @@ private:
|
||||
void RaiseError(const char* format, ...);
|
||||
void RaiseWarning(const char* format, ...);
|
||||
void VerifyStringLength(int length);
|
||||
int SkipWhitespaceAndEol();
|
||||
int FindLastLineNumber(std::string& filename);
|
||||
std::string ReadIdentifier();
|
||||
long ReadInteger(std::string filename, long line);
|
||||
};
|
||||
|
||||
#endif // ASM_FILE_H
|
||||
|
||||
Reference in New Issue
Block a user