X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=zilasm%2Fparser.h;h=007d2ffe48e09817d85b9cd51b283a85a064b185;hb=c0f515aab1285fdedb65d4582b42cc59db0c8e26;hp=c708f4d3bf75b5a3b0037b6d9a9eaafda1a3776d;hpb=e66bff85f58de39f1b850a713413b0d9c10bb9a1;p=zilutils.git diff --git a/zilasm/parser.h b/zilasm/parser.h index c708f4d..007d2ff 100644 --- a/zilasm/parser.h +++ b/zilasm/parser.h @@ -1,7 +1,7 @@ /* * parser.h -- part of ZilUtils/ZilAsm * - * Copyright (C) 2016 Jason Self + * Copyright (C) 2016, 2019, 2020 Jason Self * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -22,6 +22,30 @@ #ifndef ZILASM_PARSER #define ZILASM_PARSER 1 -int parse_file(const char *filename); -#endif /* ifndef ZILASM_PARSER */ +struct Instruction +{ + Byte *pCodes; + int size; +}; + +void init_parser (); + +int parse_file();// const char *filename); + +extern unsigned g_number_of_instructions; + +#define MAX_NUMBER_OF_INSTRUCTIONS 65536 +extern ZMemblock (*g_codes[MAX_NUMBER_OF_INSTRUCTIONS]); + +struct Parsing_Context +{ + string current_directory; + string current_file_name; +}; + +extern stack g_parsing_contexts; +extern unsigned g_currentLineNumber; +extern bool g_haveErrors; + +#endif /* ifndef ZILASM_PARSER */