mirror of
https://github.com/uffejakobsen/acme.git
synced 2025-02-07 06:31:03 +00:00
renamed some functions (to be moved to a separate file)
git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@392 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
parent
fa0b186f66
commit
b3ef885385
10
src/alu.c
10
src/alu.c
@ -1031,7 +1031,7 @@ static boolean expect_argument_or_monadic_operator(struct expression *expression
|
|||||||
register int length;
|
register int length;
|
||||||
|
|
||||||
// Read global label (or "NOT")
|
// Read global label (or "NOT")
|
||||||
length = input_read_keyword();
|
length = parser_read_keyword();
|
||||||
// Now GotByte = illegal char
|
// Now GotByte = illegal char
|
||||||
// Check for NOT. Okay, it's hardcoded,
|
// Check for NOT. Okay, it's hardcoded,
|
||||||
// but so what? Sue me...
|
// but so what? Sue me...
|
||||||
@ -1161,7 +1161,7 @@ static void expect_dyadic_operator(struct expression *expression)
|
|||||||
// Multi-character dyadic operators
|
// Multi-character dyadic operators
|
||||||
case '!': // "!="
|
case '!': // "!="
|
||||||
GetByte(); // eat '!'
|
GetByte(); // eat '!'
|
||||||
if (input_expect('=')) {
|
if (parser_expect('=')) {
|
||||||
op = &ops_not_equal;
|
op = &ops_not_equal;
|
||||||
goto push_dyadic_op;
|
goto push_dyadic_op;
|
||||||
}
|
}
|
||||||
@ -1216,7 +1216,7 @@ static void expect_dyadic_operator(struct expression *expression)
|
|||||||
default:
|
default:
|
||||||
// check string versions of operators
|
// check string versions of operators
|
||||||
if (BYTE_STARTS_KEYWORD(GotByte)) {
|
if (BYTE_STARTS_KEYWORD(GotByte)) {
|
||||||
input_read_and_lower_keyword();
|
parser_read_and_lower_keyword();
|
||||||
// Now GotByte = illegal char
|
// Now GotByte = illegal char
|
||||||
// search for tree item
|
// search for tree item
|
||||||
if (tree_easy_scan(op_tree, &node_body, GlobalDynaBuf)) {
|
if (tree_easy_scan(op_tree, &node_body, GlobalDynaBuf)) {
|
||||||
@ -2542,10 +2542,10 @@ static int parse_expression(struct expression *expression)
|
|||||||
//result->u.number.val.intval = 0;
|
//result->u.number.val.intval = 0;
|
||||||
result->u.number.addr_refs = 0;
|
result->u.number.addr_refs = 0;
|
||||||
// make sure no additional (spurious) errors are reported:
|
// make sure no additional (spurious) errors are reported:
|
||||||
input_skip_remainder();
|
parser_skip_remainder();
|
||||||
// FIXME - remove this when new function interface gets used:
|
// FIXME - remove this when new function interface gets used:
|
||||||
// callers must decide for themselves what to do when expression
|
// callers must decide for themselves what to do when expression
|
||||||
// parser returns error (and may decide to call input_skip_remainder)
|
// parser returns error (and may decide to call parser_skip_remainder)
|
||||||
return 1; // error
|
return 1; // error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ void flow_store_doloop_condition(struct condition *condition, char terminator)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// seems as if there really *is* a condition, so check for until/while
|
// seems as if there really *is* a condition, so check for until/while
|
||||||
if (input_read_and_lower_keyword()) {
|
if (parser_read_and_lower_keyword()) {
|
||||||
if (strcmp(GlobalDynaBuf->buffer, "while") == 0) {
|
if (strcmp(GlobalDynaBuf->buffer, "while") == 0) {
|
||||||
//condition.invert = FALSE;
|
//condition.invert = FALSE;
|
||||||
} else if (strcmp(GlobalDynaBuf->buffer, "until") == 0) {
|
} else if (strcmp(GlobalDynaBuf->buffer, "until") == 0) {
|
||||||
|
@ -199,7 +199,7 @@ static int first_symbol_of_statement(void)
|
|||||||
{
|
{
|
||||||
if (statement_flags & SF_FOUND_SYMBOL) {
|
if (statement_flags & SF_FOUND_SYMBOL) {
|
||||||
Throw_error("Unknown mnemonic");
|
Throw_error("Unknown mnemonic");
|
||||||
input_skip_remainder();
|
parser_skip_remainder();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
statement_flags |= SF_FOUND_SYMBOL; // now there has been one
|
statement_flags |= SF_FOUND_SYMBOL; // now there has been one
|
||||||
@ -268,7 +268,7 @@ static void parse_symbol_definition(scope_t scope)
|
|||||||
// explicit symbol definition (symbol = <something>)
|
// explicit symbol definition (symbol = <something>)
|
||||||
GetByte(); // eat '='
|
GetByte(); // eat '='
|
||||||
parse_assignment(scope, force_bit, POWER_NONE);
|
parse_assignment(scope, force_bit, POWER_NONE);
|
||||||
input_ensure_EOS();
|
parser_ensure_EOS();
|
||||||
} else {
|
} else {
|
||||||
// implicit symbol definition (label)
|
// implicit symbol definition (label)
|
||||||
set_label(scope, force_bit, POWER_NONE);
|
set_label(scope, force_bit, POWER_NONE);
|
||||||
@ -280,7 +280,7 @@ static void parse_symbol_definition(scope_t scope)
|
|||||||
static void parse_mnemo_or_global_symbol_def(void)
|
static void parse_mnemo_or_global_symbol_def(void)
|
||||||
{
|
{
|
||||||
// read keyword and ask current cpu type if it's a mnemonic
|
// read keyword and ask current cpu type if it's a mnemonic
|
||||||
if (cpu_current_type->keyword_is_mnemonic(input_read_keyword()))
|
if (cpu_current_type->keyword_is_mnemonic(parser_read_keyword()))
|
||||||
return; // statement has been handled
|
return; // statement has been handled
|
||||||
|
|
||||||
// if we're here, it wasn't a mnemonic, so it can only be a symbol name
|
// if we're here, it wasn't a mnemonic, so it can only be a symbol name
|
||||||
@ -404,7 +404,7 @@ void parse_until_eob_or_eof(void)
|
|||||||
parse_mnemo_or_global_symbol_def();
|
parse_mnemo_or_global_symbol_def();
|
||||||
} else {
|
} else {
|
||||||
Throw_error(exception_syntax); // FIXME - include char in error message!
|
Throw_error(exception_syntax); // FIXME - include char in error message!
|
||||||
input_skip_remainder();
|
parser_skip_remainder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
32
src/input.c
32
src/input.c
@ -346,8 +346,7 @@ char GetByte(void)
|
|||||||
// This function delivers the next byte from the currently active byte source
|
// This function delivers the next byte from the currently active byte source
|
||||||
// in un-shortened high-level format.
|
// in un-shortened high-level format.
|
||||||
// This function complains if CHAR_EOS (end of statement) is read.
|
// This function complains if CHAR_EOS (end of statement) is read.
|
||||||
// TODO - check if return value is actually used
|
static void get_quoted_byte(void)
|
||||||
static char GetQuotedByte(void)
|
|
||||||
{
|
{
|
||||||
int from_file; // must be an int to catch EOF
|
int from_file; // must be an int to catch EOF
|
||||||
|
|
||||||
@ -388,11 +387,10 @@ static char GetQuotedByte(void)
|
|||||||
// now check for end of statement
|
// now check for end of statement
|
||||||
if (GotByte == CHAR_EOS)
|
if (GotByte == CHAR_EOS)
|
||||||
Throw_error("Quotes still open at end of line.");
|
Throw_error("Quotes still open at end of line.");
|
||||||
return GotByte;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip remainder of statement, for example on error
|
// skip remainder of statement, for example on error
|
||||||
void input_skip_remainder(void)
|
void parser_skip_remainder(void)
|
||||||
{
|
{
|
||||||
// read characters until end-of-statement, but check for quotes,
|
// read characters until end-of-statement, but check for quotes,
|
||||||
// otherwise this might treat a quoted colon like EOS!
|
// otherwise this might treat a quoted colon like EOS!
|
||||||
@ -408,9 +406,9 @@ void input_skip_remainder(void)
|
|||||||
dynabuf_clear(GlobalDynaBuf);
|
dynabuf_clear(GlobalDynaBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that the remainder of the current statement is empty, for example
|
// ensure that the remainder of the current statement is empty, for example
|
||||||
// after mnemonics using implied addressing.
|
// after mnemonics using implied addressing.
|
||||||
void input_ensure_EOS(void) // Now GotByte = first char to test
|
void parser_ensure_EOS(void) // now GotByte = first char to test
|
||||||
{
|
{
|
||||||
SKIPSPACE();
|
SKIPSPACE();
|
||||||
if (GotByte) {
|
if (GotByte) {
|
||||||
@ -422,7 +420,7 @@ void input_ensure_EOS(void) // Now GotByte = first char to test
|
|||||||
quote = (GotByte == '\'') ? '"' : '\''; // use single quotes, unless byte is a single quote (then use double quotes)
|
quote = (GotByte == '\'') ? '"' : '\''; // use single quotes, unless byte is a single quote (then use double quotes)
|
||||||
sprintf(buf, "Expected end-of-statement, found %c%c%c instead.", quote, GotByte, quote);
|
sprintf(buf, "Expected end-of-statement, found %c%c%c instead.", quote, GotByte, quote);
|
||||||
Throw_error(buf);
|
Throw_error(buf);
|
||||||
input_skip_remainder();
|
parser_skip_remainder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,9 +432,9 @@ int input_quoted_to_dynabuf(char closing_quote)
|
|||||||
|
|
||||||
//dynabuf_clear(GlobalDynaBuf); // do not clear, caller might want to append to existing contents (TODO - check!)
|
//dynabuf_clear(GlobalDynaBuf); // do not clear, caller might want to append to existing contents (TODO - check!)
|
||||||
for (;;) {
|
for (;;) {
|
||||||
GetQuotedByte();
|
get_quoted_byte();
|
||||||
if (GotByte == CHAR_EOS)
|
if (GotByte == CHAR_EOS)
|
||||||
return 1; // unterminated string constant; GetQuotedByte will have complained already
|
return 1; // unterminated string constant; get_quoted_byte will have complained already
|
||||||
|
|
||||||
if (escaped) {
|
if (escaped) {
|
||||||
// previous byte was backslash, so do not check for terminator nor backslash
|
// previous byte was backslash, so do not check for terminator nor backslash
|
||||||
@ -644,7 +642,7 @@ int input_readscopeandsymbolname(scope_t *scope, boolean dotkluge)
|
|||||||
// character is read. Zero-terminate the string. Return its length (without
|
// character is read. Zero-terminate the string. Return its length (without
|
||||||
// terminator).
|
// terminator).
|
||||||
// Zero lengths will produce a "missing string" error.
|
// Zero lengths will produce a "missing string" error.
|
||||||
int input_read_keyword(void)
|
int parser_read_keyword(void)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
@ -659,7 +657,7 @@ int input_read_keyword(void)
|
|||||||
// character is read. Zero-terminate the string, then convert to lower case.
|
// character is read. Zero-terminate the string, then convert to lower case.
|
||||||
// Return its length (without terminator).
|
// Return its length (without terminator).
|
||||||
// Zero lengths will produce a "missing string" error.
|
// Zero lengths will produce a "missing string" error.
|
||||||
int input_read_and_lower_keyword(void)
|
int parser_read_and_lower_keyword(void)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
@ -676,7 +674,7 @@ int input_read_and_lower_keyword(void)
|
|||||||
// UNIX style to platform style.
|
// UNIX style to platform style.
|
||||||
// Returns nonzero on error. Filename in GlobalDynaBuf, including terminator.
|
// Returns nonzero on error. Filename in GlobalDynaBuf, including terminator.
|
||||||
// Errors are handled and reported, but caller should call
|
// Errors are handled and reported, but caller should call
|
||||||
// input_skip_remainder() then.
|
// parser_skip_remainder() then.
|
||||||
static int read_filename_shared_end(boolean *absolute)
|
static int read_filename_shared_end(boolean *absolute)
|
||||||
{
|
{
|
||||||
// check length
|
// check length
|
||||||
@ -712,7 +710,7 @@ static int read_filename_shared_end(boolean *absolute)
|
|||||||
// UNIX style to platform style.
|
// UNIX style to platform style.
|
||||||
// Returns nonzero on error. Filename in GlobalDynaBuf.
|
// Returns nonzero on error. Filename in GlobalDynaBuf.
|
||||||
// Errors are handled and reported, but caller should call
|
// Errors are handled and reported, but caller should call
|
||||||
// input_skip_remainder() then.
|
// parser_skip_remainder() then.
|
||||||
int input_read_input_filename(struct filespecflags *flags)
|
int input_read_input_filename(struct filespecflags *flags)
|
||||||
{
|
{
|
||||||
dynabuf_clear(GlobalDynaBuf);
|
dynabuf_clear(GlobalDynaBuf);
|
||||||
@ -751,7 +749,7 @@ int input_read_input_filename(struct filespecflags *flags)
|
|||||||
|
|
||||||
// Try to read a comma, skipping spaces before and after. Return TRUE if comma
|
// Try to read a comma, skipping spaces before and after. Return TRUE if comma
|
||||||
// found, otherwise FALSE.
|
// found, otherwise FALSE.
|
||||||
int input_accept_comma(void)
|
int parser_accept_comma(void)
|
||||||
{
|
{
|
||||||
SKIPSPACE();
|
SKIPSPACE();
|
||||||
if (GotByte != ',')
|
if (GotByte != ',')
|
||||||
@ -764,7 +762,7 @@ int input_accept_comma(void)
|
|||||||
// Try to read given character.
|
// Try to read given character.
|
||||||
// If found, eat character and return TRUE.
|
// If found, eat character and return TRUE.
|
||||||
// If not found, throw syntax error and return FALSE.
|
// If not found, throw syntax error and return FALSE.
|
||||||
int input_expect(int chr)
|
int parser_expect(int chr)
|
||||||
{
|
{
|
||||||
// one caller uses this to read the '=' part of "!=", so
|
// one caller uses this to read the '=' part of "!=", so
|
||||||
// do not call SKIPSPACE() here!
|
// do not call SKIPSPACE() here!
|
||||||
@ -844,7 +842,7 @@ static void default_path_to_pathbuf(void)
|
|||||||
// UNIX style to platform style.
|
// UNIX style to platform style.
|
||||||
// Returns nonzero on error. Filename in GlobalDynaBuf.
|
// Returns nonzero on error. Filename in GlobalDynaBuf.
|
||||||
// Errors are handled and reported, but caller should call
|
// Errors are handled and reported, but caller should call
|
||||||
// input_skip_remainder() then.
|
// parser_skip_remainder() then.
|
||||||
//
|
//
|
||||||
// this is only used for "!to" and "!sl", i.e. output file names. these
|
// this is only used for "!to" and "!sl", i.e. output file names. these
|
||||||
// must be given as a literal string, and it should be kept this way.
|
// must be given as a literal string, and it should be kept this way.
|
||||||
|
28
src/input.h
28
src/input.h
@ -36,7 +36,8 @@ struct filespecflags {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Constants
|
// constants
|
||||||
|
|
||||||
extern const char FILE_READBINARY[];
|
extern const char FILE_READBINARY[];
|
||||||
// Special characters
|
// Special characters
|
||||||
// The program *heavily* relies on CHAR_EOS (end of statement) being 0x00!
|
// The program *heavily* relies on CHAR_EOS (end of statement) being 0x00!
|
||||||
@ -48,7 +49,8 @@ extern const char FILE_READBINARY[];
|
|||||||
// if the characters above are changed, don't forget to adjust global_byte_flags[]!
|
// if the characters above are changed, don't forget to adjust global_byte_flags[]!
|
||||||
|
|
||||||
|
|
||||||
// Variables
|
// variables
|
||||||
|
|
||||||
extern char GotByte; // last byte read (processed)
|
extern char GotByte; // last byte read (processed)
|
||||||
// name of source file used for resolving relative paths
|
// name of source file used for resolving relative paths
|
||||||
// (i.e. not changed during macro execution):
|
// (i.e. not changed during macro execution):
|
||||||
@ -56,18 +58,18 @@ extern const char *input_plat_pathref_filename; // file name in platform format
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Prototypes
|
// prototypes
|
||||||
|
|
||||||
// get next byte from currently active byte source in shortened high-level
|
// get next byte from currently active byte source in shortened high-level
|
||||||
// format. When inside quotes, use input_quoted_to_dynabuf() instead!
|
// format. When inside quotes, use input_quoted_to_dynabuf() instead!
|
||||||
extern char GetByte(void);
|
extern char GetByte(void);
|
||||||
|
|
||||||
// Skip remainder of statement, for example on error
|
// skip remainder of statement, for example on error
|
||||||
extern void input_skip_remainder(void);
|
extern void parser_skip_remainder(void);
|
||||||
|
|
||||||
// Ensure that the remainder of the current statement is empty, for example
|
// ensure that the remainder of the current statement is empty, for example
|
||||||
// after mnemonics using implied addressing.
|
// after mnemonics using implied addressing.
|
||||||
extern void input_ensure_EOS(void);
|
extern void parser_ensure_EOS(void);
|
||||||
|
|
||||||
// read string to dynabuf until closing quote is found
|
// read string to dynabuf until closing quote is found
|
||||||
// returns 1 on errors (unterminated, escaping error)
|
// returns 1 on errors (unterminated, escaping error)
|
||||||
@ -104,13 +106,13 @@ extern int input_readscopeandsymbolname(scope_t *scope, boolean dotkluge);
|
|||||||
// character is read. Zero-terminate the string. Return its length (without
|
// character is read. Zero-terminate the string. Return its length (without
|
||||||
// terminator).
|
// terminator).
|
||||||
// Zero lengths will produce a "missing string" error.
|
// Zero lengths will produce a "missing string" error.
|
||||||
extern int input_read_keyword(void);
|
extern int parser_read_keyword(void);
|
||||||
|
|
||||||
// Clear dynamic buffer, then append to it until an illegal (for a keyword)
|
// Clear dynamic buffer, then append to it until an illegal (for a keyword)
|
||||||
// character is read. Zero-terminate the string, then convert to lower case.
|
// character is read. Zero-terminate the string, then convert to lower case.
|
||||||
// Return its length (without terminator).
|
// Return its length (without terminator).
|
||||||
// Zero lengths will produce a "missing string" error.
|
// Zero lengths will produce a "missing string" error.
|
||||||
extern int input_read_and_lower_keyword(void);
|
extern int parser_read_and_lower_keyword(void);
|
||||||
|
|
||||||
// try to read a file name for an input file.
|
// try to read a file name for an input file.
|
||||||
// library access by using <...> quoting is allowed.
|
// library access by using <...> quoting is allowed.
|
||||||
@ -119,7 +121,7 @@ extern int input_read_and_lower_keyword(void);
|
|||||||
// UNIX style to platform style.
|
// UNIX style to platform style.
|
||||||
// Returns nonzero on error. Filename in GlobalDynaBuf.
|
// Returns nonzero on error. Filename in GlobalDynaBuf.
|
||||||
// Errors are handled and reported, but caller should call
|
// Errors are handled and reported, but caller should call
|
||||||
// input_skip_remainder() then.
|
// parser_skip_remainder() then.
|
||||||
extern int input_read_input_filename(struct filespecflags *flags);
|
extern int input_read_input_filename(struct filespecflags *flags);
|
||||||
|
|
||||||
// try to read a file name for an output file ("!to" and "!sl" only).
|
// try to read a file name for an output file ("!to" and "!sl" only).
|
||||||
@ -128,19 +130,19 @@ extern int input_read_input_filename(struct filespecflags *flags);
|
|||||||
// UNIX style to platform style.
|
// UNIX style to platform style.
|
||||||
// Returns nonzero on error. Filename in GlobalDynaBuf.
|
// Returns nonzero on error. Filename in GlobalDynaBuf.
|
||||||
// Errors are handled and reported, but caller should call
|
// Errors are handled and reported, but caller should call
|
||||||
// input_skip_remainder() then.
|
// parser_skip_remainder() then.
|
||||||
// FIXME - the name suggests this fn reads "the" output filename, but it only
|
// FIXME - the name suggests this fn reads "the" output filename, but it only
|
||||||
// reads "an" output filename: either symbollist or the real output file.
|
// reads "an" output filename: either symbollist or the real output file.
|
||||||
extern int input_read_output_filename(void);
|
extern int input_read_output_filename(void);
|
||||||
|
|
||||||
// Try to read a comma, skipping spaces before and after. Return TRUE if comma
|
// Try to read a comma, skipping spaces before and after. Return TRUE if comma
|
||||||
// found, otherwise FALSE.
|
// found, otherwise FALSE.
|
||||||
extern int input_accept_comma(void);
|
extern int parser_accept_comma(void);
|
||||||
|
|
||||||
// Try to read given character.
|
// Try to read given character.
|
||||||
// If found, eat character and return TRUE.
|
// If found, eat character and return TRUE.
|
||||||
// If not found, throw syntax error and return FALSE.
|
// If not found, throw syntax error and return FALSE.
|
||||||
extern int input_expect(int chr);
|
extern int parser_expect(int chr);
|
||||||
|
|
||||||
// force input system to return "end of file" on next read
|
// force input system to return "end of file" on next read
|
||||||
// (back end function for "!eof" pseudo opcode)
|
// (back end function for "!eof" pseudo opcode)
|
||||||
|
10
src/macro.c
10
src/macro.c
@ -89,7 +89,7 @@ static int pipe_comma(void)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = input_accept_comma();
|
result = parser_accept_comma();
|
||||||
if (result)
|
if (result)
|
||||||
DYNABUF_APPEND(GlobalDynaBuf, ',');
|
DYNABUF_APPEND(GlobalDynaBuf, ',');
|
||||||
return result;
|
return result;
|
||||||
@ -226,7 +226,7 @@ void macro_parse_call(void) // Now GotByte = first char of macro name
|
|||||||
ALU_any_result(&(arg_table[arg_count].result));
|
ALU_any_result(&(arg_table[arg_count].result));
|
||||||
}
|
}
|
||||||
++arg_count;
|
++arg_count;
|
||||||
} while (input_accept_comma());
|
} while (parser_accept_comma());
|
||||||
}
|
}
|
||||||
// now arg_table contains the arguments
|
// now arg_table contains the arguments
|
||||||
// now GlobalDynaBuf = unused
|
// now GlobalDynaBuf = unused
|
||||||
@ -235,7 +235,7 @@ void macro_parse_call(void) // Now GotByte = first char of macro name
|
|||||||
search_for_macro(¯o_node, macro_scope, FALSE);
|
search_for_macro(¯o_node, macro_scope, FALSE);
|
||||||
if (macro_node == NULL) {
|
if (macro_node == NULL) {
|
||||||
Throw_error("Macro not defined (or wrong signature).");
|
Throw_error("Macro not defined (or wrong signature).");
|
||||||
input_skip_remainder();
|
parser_skip_remainder();
|
||||||
} else {
|
} else {
|
||||||
// make macro_node point to the macro struct
|
// make macro_node point to the macro struct
|
||||||
actual_macro = macro_node->body;
|
actual_macro = macro_node->body;
|
||||||
@ -282,7 +282,7 @@ void macro_parse_call(void) // Now GotByte = first char of macro name
|
|||||||
symbol->object = arg_table[arg_count].result; // FIXME - this assignment redefines globals/whatever without throwing errors!
|
symbol->object = arg_table[arg_count].result; // FIXME - this assignment redefines globals/whatever without throwing errors!
|
||||||
}
|
}
|
||||||
++arg_count;
|
++arg_count;
|
||||||
} while (input_accept_comma());
|
} while (parser_accept_comma());
|
||||||
}
|
}
|
||||||
|
|
||||||
// and now, finally, parse the actual macro body
|
// and now, finally, parse the actual macro body
|
||||||
@ -303,7 +303,7 @@ void macro_parse_call(void) // Now GotByte = first char of macro name
|
|||||||
if (outer_msg_sum != pass.warning_count + pass.error_count)
|
if (outer_msg_sum != pass.warning_count + pass.error_count)
|
||||||
Throw_warning("...called from here.");
|
Throw_warning("...called from here.");
|
||||||
|
|
||||||
input_ensure_EOS();
|
parser_ensure_EOS();
|
||||||
}
|
}
|
||||||
++sanity.macro_recursions_left; // leave this nesting level
|
++sanity.macro_recursions_left; // leave this nesting level
|
||||||
}
|
}
|
||||||
|
22
src/mnemo.c
22
src/mnemo.c
@ -542,7 +542,7 @@ static struct ronode mnemo_m65_tree[] = {
|
|||||||
// TODO: add pointer arg for result, use return value to indicate parse error!
|
// TODO: add pointer arg for result, use return value to indicate parse error!
|
||||||
static int get_index(void)
|
static int get_index(void)
|
||||||
{
|
{
|
||||||
if (!input_accept_comma())
|
if (!parser_accept_comma())
|
||||||
return INDEX_NONE;
|
return INDEX_NONE;
|
||||||
|
|
||||||
// there was a comma, so check next character (spaces will have been skipped):
|
// there was a comma, so check next character (spaces will have been skipped):
|
||||||
@ -614,7 +614,7 @@ static bits get_addr_mode(struct number *result)
|
|||||||
GetByte(); // eat '['
|
GetByte(); // eat '['
|
||||||
get_int_arg(result, FALSE);
|
get_int_arg(result, FALSE);
|
||||||
typesystem_want_addr(result);
|
typesystem_want_addr(result);
|
||||||
if (input_expect(']')) {
|
if (parser_expect(']')) {
|
||||||
address_mode_bits = AMB_LONGINDIRECT | AMB_INDEX(get_index());
|
address_mode_bits = AMB_LONGINDIRECT | AMB_INDEX(get_index());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -630,7 +630,7 @@ static bits get_addr_mode(struct number *result)
|
|||||||
// in case there are still open parentheses,
|
// in case there are still open parentheses,
|
||||||
// read internal index
|
// read internal index
|
||||||
address_mode_bits |= AMB_PREINDEX(get_index());
|
address_mode_bits |= AMB_PREINDEX(get_index());
|
||||||
if (input_expect(')')) {
|
if (parser_expect(')')) {
|
||||||
// fn already does everything for us!
|
// fn already does everything for us!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -638,7 +638,7 @@ static bits get_addr_mode(struct number *result)
|
|||||||
address_mode_bits |= AMB_INDEX(get_index());
|
address_mode_bits |= AMB_INDEX(get_index());
|
||||||
}
|
}
|
||||||
// ensure end of line
|
// ensure end of line
|
||||||
input_ensure_EOS();
|
parser_ensure_EOS();
|
||||||
//printf("AM: %x\n", address_mode_bits);
|
//printf("AM: %x\n", address_mode_bits);
|
||||||
return address_mode_bits;
|
return address_mode_bits;
|
||||||
}
|
}
|
||||||
@ -781,7 +781,7 @@ static void group_only_implied_addressing(int opcode)
|
|||||||
Throw_warning("Found SED instruction for CPU with known decimal SBC bug.");
|
Throw_warning("Found SED instruction for CPU with known decimal SBC bug.");
|
||||||
}
|
}
|
||||||
output_byte(opcode);
|
output_byte(opcode);
|
||||||
input_ensure_EOS();
|
parser_ensure_EOS();
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper function to output "Target not in bank" message
|
// helper function to output "Target not in bank" message
|
||||||
@ -825,7 +825,7 @@ static void near_branch(int preoffset)
|
|||||||
// so use output_byte() instead of output_8()
|
// so use output_byte() instead of output_8()
|
||||||
//output_8(offset);
|
//output_8(offset);
|
||||||
output_byte(offset);
|
output_byte(offset);
|
||||||
input_ensure_EOS();
|
parser_ensure_EOS();
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper function for relative addressing with 16-bit offset
|
// helper function for relative addressing with 16-bit offset
|
||||||
@ -847,7 +847,7 @@ static void far_branch(int preoffset)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
output_le16(offset);
|
output_le16(offset);
|
||||||
input_ensure_EOS();
|
parser_ensure_EOS();
|
||||||
}
|
}
|
||||||
|
|
||||||
// set addressing mode bits depending on which opcodes exist, then calculate
|
// set addressing mode bits depending on which opcodes exist, then calculate
|
||||||
@ -1044,7 +1044,7 @@ static void group_bbr_bbs(int opcode)
|
|||||||
|
|
||||||
get_int_arg(&zpmem, TRUE);
|
get_int_arg(&zpmem, TRUE);
|
||||||
typesystem_want_addr(&zpmem);
|
typesystem_want_addr(&zpmem);
|
||||||
if (input_expect(',')) {
|
if (parser_expect(',')) {
|
||||||
output_byte(opcode);
|
output_byte(opcode);
|
||||||
output_byte(zpmem.val.intval);
|
output_byte(zpmem.val.intval);
|
||||||
near_branch(3);
|
near_branch(3);
|
||||||
@ -1079,7 +1079,7 @@ static void group_mvn_mvp(int opcode)
|
|||||||
get_int_arg(&source, TRUE);
|
get_int_arg(&source, TRUE);
|
||||||
typesystem_want_nonaddr(&source);
|
typesystem_want_nonaddr(&source);
|
||||||
// get comma
|
// get comma
|
||||||
if (!input_expect(',')) {
|
if (!parser_expect(',')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SKIPSPACE();
|
SKIPSPACE();
|
||||||
@ -1097,7 +1097,7 @@ static void group_mvn_mvp(int opcode)
|
|||||||
// sanity check
|
// sanity check
|
||||||
if (unmatched_hash)
|
if (unmatched_hash)
|
||||||
Throw_error(exception_syntax); // FIXME - maybe "Use ARG,ARG or #ARG,#ARG but do not mix and match"?
|
Throw_error(exception_syntax); // FIXME - maybe "Use ARG,ARG or #ARG,#ARG but do not mix and match"?
|
||||||
input_ensure_EOS();
|
parser_ensure_EOS();
|
||||||
}
|
}
|
||||||
|
|
||||||
// "rmb0..7" and "smb0..7"
|
// "rmb0..7" and "smb0..7"
|
||||||
@ -1110,7 +1110,7 @@ static void group_only_zp(int opcode)
|
|||||||
typesystem_want_addr(&target);
|
typesystem_want_addr(&target);
|
||||||
output_byte(opcode);
|
output_byte(opcode);
|
||||||
output_8(target.val.intval);
|
output_8(target.val.intval);
|
||||||
input_ensure_EOS();
|
parser_ensure_EOS();
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOP on m65 cpu (FIXME - "!align" outputs NOPs, what about that? what if user writes NEG:NEG?)
|
// NOP on m65 cpu (FIXME - "!align" outputs NOPs, what about that? what if user writes NEG:NEG?)
|
||||||
|
@ -102,10 +102,10 @@ static enum eos po_to(void)
|
|||||||
config.output_filename = dynabuf_get_copy(GlobalDynaBuf);
|
config.output_filename = dynabuf_get_copy(GlobalDynaBuf);
|
||||||
|
|
||||||
// select output format
|
// select output format
|
||||||
if (input_accept_comma()) {
|
if (parser_accept_comma()) {
|
||||||
// parse output format name
|
// parse output format name
|
||||||
// if no keyword given, give up
|
// if no keyword given, give up
|
||||||
if (input_read_and_lower_keyword() == 0)
|
if (parser_read_and_lower_keyword() == 0)
|
||||||
return SKIP_REMAINDER;
|
return SKIP_REMAINDER;
|
||||||
|
|
||||||
format = outputformat_find();
|
format = outputformat_find();
|
||||||
@ -228,7 +228,7 @@ static enum eos iterate(void (*fn)(intval_t))
|
|||||||
do {
|
do {
|
||||||
ALU_any_result(&object);
|
ALU_any_result(&object);
|
||||||
output_object(&object, &iter);
|
output_object(&object, &iter);
|
||||||
} while (input_accept_comma());
|
} while (parser_accept_comma());
|
||||||
return ENSURE_EOS;
|
return ENSURE_EOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,7 +427,7 @@ static enum eos po_convtab(void)
|
|||||||
|
|
||||||
// expect keyword: either one of the pre-defined encodings or
|
// expect keyword: either one of the pre-defined encodings or
|
||||||
// "file" with a filename argument:
|
// "file" with a filename argument:
|
||||||
if (input_read_and_lower_keyword() == 0)
|
if (parser_read_and_lower_keyword() == 0)
|
||||||
return SKIP_REMAINDER; // "No string given" error has already been thrown
|
return SKIP_REMAINDER; // "No string given" error has already been thrown
|
||||||
|
|
||||||
// now check for known keywords:
|
// now check for known keywords:
|
||||||
@ -442,7 +442,7 @@ static enum eos po_convtab(void)
|
|||||||
|
|
||||||
if (strcmp(GlobalDynaBuf->buffer, "file") == 0) {
|
if (strcmp(GlobalDynaBuf->buffer, "file") == 0) {
|
||||||
SKIPSPACE();
|
SKIPSPACE();
|
||||||
if (!input_expect('=')) {
|
if (!parser_expect('=')) {
|
||||||
return SKIP_REMAINDER;
|
return SKIP_REMAINDER;
|
||||||
}
|
}
|
||||||
return use_encoding_from_file();
|
return use_encoding_from_file();
|
||||||
@ -492,7 +492,7 @@ static enum eos encode_string(const struct encoder *inner_encoder, unsigned char
|
|||||||
ALU_any_result(&object);
|
ALU_any_result(&object);
|
||||||
output_object(&object, &iter);
|
output_object(&object, &iter);
|
||||||
}
|
}
|
||||||
} while (input_accept_comma());
|
} while (parser_accept_comma());
|
||||||
encoder_current = outer_encoder; // reactivate buffered encoder
|
encoder_current = outer_encoder; // reactivate buffered encoder
|
||||||
return ENSURE_EOS;
|
return ENSURE_EOS;
|
||||||
}
|
}
|
||||||
@ -522,7 +522,7 @@ static enum eos po_scrxor(void)
|
|||||||
intval_t xor;
|
intval_t xor;
|
||||||
|
|
||||||
ALU_any_int(&xor);
|
ALU_any_int(&xor);
|
||||||
if (input_expect(',')) {
|
if (parser_expect(',')) {
|
||||||
return encode_string(&encoder_scr, xor);
|
return encode_string(&encoder_scr, xor);
|
||||||
}
|
}
|
||||||
return SKIP_REMAINDER;
|
return SKIP_REMAINDER;
|
||||||
@ -551,7 +551,7 @@ static enum eos po_binary(void)
|
|||||||
return SKIP_REMAINDER;
|
return SKIP_REMAINDER;
|
||||||
|
|
||||||
// read optional arguments
|
// read optional arguments
|
||||||
if (input_accept_comma()) {
|
if (parser_accept_comma()) {
|
||||||
// any size given?
|
// any size given?
|
||||||
if ((GotByte != ',') && (GotByte != CHAR_EOS)) {
|
if ((GotByte != ',') && (GotByte != CHAR_EOS)) {
|
||||||
// then parse it
|
// then parse it
|
||||||
@ -560,7 +560,7 @@ static enum eos po_binary(void)
|
|||||||
Throw_serious_error(exception_negative_size);
|
Throw_serious_error(exception_negative_size);
|
||||||
}
|
}
|
||||||
// more?
|
// more?
|
||||||
if (input_accept_comma()) {
|
if (parser_accept_comma()) {
|
||||||
// any skip given?
|
// any skip given?
|
||||||
if (GotByte != CHAR_EOS) {
|
if (GotByte != CHAR_EOS) {
|
||||||
// then parse it
|
// then parse it
|
||||||
@ -614,7 +614,7 @@ static enum eos po_fill(void)
|
|||||||
intval_t fill = FILLVALUE_FILL;
|
intval_t fill = FILLVALUE_FILL;
|
||||||
|
|
||||||
ALU_defined_int(&sizeresult); // FIXME - forbid addresses!
|
ALU_defined_int(&sizeresult); // FIXME - forbid addresses!
|
||||||
if (input_accept_comma())
|
if (parser_accept_comma())
|
||||||
ALU_any_int(&fill); // FIXME - forbid addresses!
|
ALU_any_int(&fill); // FIXME - forbid addresses!
|
||||||
while (sizeresult.val.intval--)
|
while (sizeresult.val.intval--)
|
||||||
output_8(fill);
|
output_8(fill);
|
||||||
@ -650,11 +650,11 @@ static enum eos po_align(void)
|
|||||||
// now: "!align ANDVALUE, EQUALVALUE [,FILLVALUE]"
|
// now: "!align ANDVALUE, EQUALVALUE [,FILLVALUE]"
|
||||||
// in future: "!align BLOCKSIZE" where block size must be a power of two
|
// in future: "!align BLOCKSIZE" where block size must be a power of two
|
||||||
ALU_defined_int(&andresult); // FIXME - forbid addresses!
|
ALU_defined_int(&andresult); // FIXME - forbid addresses!
|
||||||
if (input_expect(',')) {
|
if (parser_expect(',')) {
|
||||||
// fn already does everything for us
|
// fn already does everything for us
|
||||||
}
|
}
|
||||||
ALU_defined_int(&equalresult); // ...allow addresses (unlikely, but possible)
|
ALU_defined_int(&equalresult); // ...allow addresses (unlikely, but possible)
|
||||||
if (input_accept_comma())
|
if (parser_accept_comma())
|
||||||
ALU_any_int(&fill);
|
ALU_any_int(&fill);
|
||||||
else
|
else
|
||||||
fill = cpu_current_type->default_align_value;
|
fill = cpu_current_type->default_align_value;
|
||||||
@ -698,9 +698,9 @@ static enum eos po_pseudopc(void)
|
|||||||
ALU_defined_int(&new_pc); // FIXME - allow for undefined! (complaining about non-addresses would be logical, but annoying)
|
ALU_defined_int(&new_pc); // FIXME - allow for undefined! (complaining about non-addresses would be logical, but annoying)
|
||||||
/* TODO - add this. check if code can be shared with "*="!
|
/* TODO - add this. check if code can be shared with "*="!
|
||||||
// check for modifiers
|
// check for modifiers
|
||||||
while (input_accept_comma()) {
|
while (parser_accept_comma()) {
|
||||||
// parse modifier. if no keyword given, give up
|
// parse modifier. if no keyword given, give up
|
||||||
if (input_read_and_lower_keyword() == 0)
|
if (parser_read_and_lower_keyword() == 0)
|
||||||
return SKIP_REMAINDER;
|
return SKIP_REMAINDER;
|
||||||
|
|
||||||
if (strcmp(GlobalDynaBuf->buffer, "limit") == 0) {
|
if (strcmp(GlobalDynaBuf->buffer, "limit") == 0) {
|
||||||
@ -754,7 +754,7 @@ static enum eos po_cpu(void)
|
|||||||
const struct cpu_type *cpu_buffer = cpu_current_type; // remember
|
const struct cpu_type *cpu_buffer = cpu_current_type; // remember
|
||||||
const struct cpu_type *new_cpu_type;
|
const struct cpu_type *new_cpu_type;
|
||||||
|
|
||||||
if (input_read_and_lower_keyword()) {
|
if (parser_read_and_lower_keyword()) {
|
||||||
new_cpu_type = cputype_find();
|
new_cpu_type = cputype_find();
|
||||||
if (new_cpu_type)
|
if (new_cpu_type)
|
||||||
cpu_current_type = new_cpu_type; // activate new cpu type
|
cpu_current_type = new_cpu_type; // activate new cpu type
|
||||||
@ -827,7 +827,7 @@ static enum eos po_set(void) // now GotByte = illegal char
|
|||||||
return SKIP_REMAINDER; // zero length
|
return SKIP_REMAINDER; // zero length
|
||||||
|
|
||||||
force_bit = parser_get_force_bit(); // skips spaces after
|
force_bit = parser_get_force_bit(); // skips spaces after
|
||||||
if (!input_expect('='))
|
if (!parser_expect('='))
|
||||||
return SKIP_REMAINDER;
|
return SKIP_REMAINDER;
|
||||||
|
|
||||||
// TODO: in versions before 0.97, force bit handling was broken in both
|
// TODO: in versions before 0.97, force bit handling was broken in both
|
||||||
@ -859,7 +859,7 @@ static enum eos po_zone(void)
|
|||||||
if (BYTE_CONTINUES_KEYWORD(GotByte)) {
|
if (BYTE_CONTINUES_KEYWORD(GotByte)) {
|
||||||
// because we know of one character for sure,
|
// because we know of one character for sure,
|
||||||
// there's no need to check the return value.
|
// there's no need to check the return value.
|
||||||
input_read_keyword();
|
parser_read_keyword();
|
||||||
new_title = dynabuf_get_copy(GlobalDynaBuf);
|
new_title = dynabuf_get_copy(GlobalDynaBuf);
|
||||||
allocated = TRUE;
|
allocated = TRUE;
|
||||||
}
|
}
|
||||||
@ -989,7 +989,7 @@ static enum eos ifelse(enum ifmode mode)
|
|||||||
return AT_EOS_ANYWAY; // normal exit if there is no ELSE {...} block
|
return AT_EOS_ANYWAY; // normal exit if there is no ELSE {...} block
|
||||||
|
|
||||||
// read keyword (expected to be "else")
|
// read keyword (expected to be "else")
|
||||||
if (input_read_and_lower_keyword() == 0)
|
if (parser_read_and_lower_keyword() == 0)
|
||||||
return SKIP_REMAINDER; // "missing string error" -> ignore rest of line
|
return SKIP_REMAINDER; // "missing string error" -> ignore rest of line
|
||||||
|
|
||||||
// make sure it's "else"
|
// make sure it's "else"
|
||||||
@ -1006,7 +1006,7 @@ static enum eos ifelse(enum ifmode mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// read keyword (expected to be if/ifdef/ifndef)
|
// read keyword (expected to be if/ifdef/ifndef)
|
||||||
if (input_read_and_lower_keyword() == 0)
|
if (parser_read_and_lower_keyword() == 0)
|
||||||
return SKIP_REMAINDER; // "missing string error" -> ignore rest of line
|
return SKIP_REMAINDER; // "missing string error" -> ignore rest of line
|
||||||
|
|
||||||
// which one is it?
|
// which one is it?
|
||||||
@ -1061,12 +1061,12 @@ static enum eos po_for(void) // now GotByte = illegal char
|
|||||||
// now GotByte = illegal char
|
// now GotByte = illegal char
|
||||||
force_bit = parser_get_force_bit(); // skips spaces after
|
force_bit = parser_get_force_bit(); // skips spaces after
|
||||||
loop.symbol = symbol_find(scope); // if not number, error will be reported on first assignment
|
loop.symbol = symbol_find(scope); // if not number, error will be reported on first assignment
|
||||||
if (input_accept_comma()) {
|
if (parser_accept_comma()) {
|
||||||
// counter syntax (old or new)
|
// counter syntax (old or new)
|
||||||
loop.u.counter.force_bit = force_bit;
|
loop.u.counter.force_bit = force_bit;
|
||||||
ALU_defined_int(&intresult); // read first argument
|
ALU_defined_int(&intresult); // read first argument
|
||||||
loop.u.counter.addr_refs = intresult.addr_refs;
|
loop.u.counter.addr_refs = intresult.addr_refs;
|
||||||
if (input_accept_comma()) {
|
if (parser_accept_comma()) {
|
||||||
// new counter syntax
|
// new counter syntax
|
||||||
loop.algorithm = FORALGO_NEWCOUNT;
|
loop.algorithm = FORALGO_NEWCOUNT;
|
||||||
if (config.dialect < V0_94_12__NEW_FOR_SYNTAX) {
|
if (config.dialect < V0_94_12__NEW_FOR_SYNTAX) {
|
||||||
@ -1120,9 +1120,9 @@ was just a typo. if the current byte is '.' or '-' or whatever, then trying to
|
|||||||
read a keyword will result in "No string given" - which is confusing for the
|
read a keyword will result in "No string given" - which is confusing for the
|
||||||
user if they did not even want to put a string there.
|
user if they did not even want to put a string there.
|
||||||
so if the current byte is not the start of "in" we just throw a syntax error.
|
so if the current byte is not the start of "in" we just throw a syntax error.
|
||||||
knowing there is an "i" also makes sure that input_read_and_lower_keyword()
|
knowing there is an "i" also makes sure that parser_read_and_lower_keyword()
|
||||||
does not fail. */
|
does not fail. */
|
||||||
input_read_and_lower_keyword();
|
parser_read_and_lower_keyword();
|
||||||
if (strcmp(GlobalDynaBuf->buffer, "in") != 0) {
|
if (strcmp(GlobalDynaBuf->buffer, "in") != 0) {
|
||||||
Throw_error(exception_want_IN_or_comma);
|
Throw_error(exception_want_IN_or_comma);
|
||||||
return SKIP_REMAINDER; // FIXME - this ignores '{' and will then complain about '}'
|
return SKIP_REMAINDER; // FIXME - this ignores '{' and will then complain about '}'
|
||||||
@ -1238,7 +1238,7 @@ static enum eos tracewatch(boolean enter_monitor)
|
|||||||
if (GotByte != CHAR_EOS) {
|
if (GotByte != CHAR_EOS) {
|
||||||
do {
|
do {
|
||||||
// parse flag. if no keyword given, give up
|
// parse flag. if no keyword given, give up
|
||||||
if (input_read_and_lower_keyword() == 0)
|
if (parser_read_and_lower_keyword() == 0)
|
||||||
return SKIP_REMAINDER; // fail (error has been reported)
|
return SKIP_REMAINDER; // fail (error has been reported)
|
||||||
|
|
||||||
if (strcmp(GlobalDynaBuf->buffer, "load") == 0) {
|
if (strcmp(GlobalDynaBuf->buffer, "load") == 0) {
|
||||||
@ -1251,7 +1251,7 @@ static enum eos tracewatch(boolean enter_monitor)
|
|||||||
Throw_error("Unknown flag (known are: load, store, exec)."); // FIXME - add to docs!
|
Throw_error("Unknown flag (known are: load, store, exec)."); // FIXME - add to docs!
|
||||||
return SKIP_REMAINDER;
|
return SKIP_REMAINDER;
|
||||||
}
|
}
|
||||||
} while (input_accept_comma());
|
} while (parser_accept_comma());
|
||||||
}
|
}
|
||||||
// shortcut: no flags at all -> set all flags!
|
// shortcut: no flags at all -> set all flags!
|
||||||
if (!flags)
|
if (!flags)
|
||||||
@ -1349,7 +1349,7 @@ static enum eos throw_src_string(enum debuglevel level, const char prefix[])
|
|||||||
ALU_any_result(&object);
|
ALU_any_result(&object);
|
||||||
object.type->print(&object, user_message);
|
object.type->print(&object, user_message);
|
||||||
}
|
}
|
||||||
} while (input_accept_comma());
|
} while (parser_accept_comma());
|
||||||
dynabuf_append(user_message, '\0');
|
dynabuf_append(user_message, '\0');
|
||||||
throw_message(level, user_message->buffer, NULL);
|
throw_message(level, user_message->buffer, NULL);
|
||||||
return ENSURE_EOS;
|
return ENSURE_EOS;
|
||||||
@ -1361,7 +1361,7 @@ static enum eos po_debug(void)
|
|||||||
struct number debuglevel;
|
struct number debuglevel;
|
||||||
|
|
||||||
ALU_defined_int(&debuglevel);
|
ALU_defined_int(&debuglevel);
|
||||||
if (!input_expect(','))
|
if (!parser_expect(','))
|
||||||
return SKIP_REMAINDER;
|
return SKIP_REMAINDER;
|
||||||
|
|
||||||
// drop this one?
|
// drop this one?
|
||||||
@ -1400,7 +1400,7 @@ static enum eos po_serious(void)
|
|||||||
// end of source file ("!endoffile" or "!eof")
|
// end of source file ("!endoffile" or "!eof")
|
||||||
static enum eos po_endoffile(void)
|
static enum eos po_endoffile(void)
|
||||||
{
|
{
|
||||||
input_ensure_EOS(); // make sure there are no args
|
parser_ensure_EOS(); // make sure there are no args
|
||||||
input_force_eof(); // fake end of file
|
input_force_eof(); // fake end of file
|
||||||
return AT_EOS_ANYWAY;
|
return AT_EOS_ANYWAY;
|
||||||
}
|
}
|
||||||
@ -1495,7 +1495,7 @@ void pseudoopcode_parse(void) // now GotByte = '!' (or '.' in case of --fullstop
|
|||||||
|
|
||||||
GetByte(); // read next byte
|
GetByte(); // read next byte
|
||||||
// on missing keyword, return (complaining will have been done)
|
// on missing keyword, return (complaining will have been done)
|
||||||
if (input_read_and_lower_keyword()) {
|
if (parser_read_and_lower_keyword()) {
|
||||||
// search for tree item
|
// search for tree item
|
||||||
if ((tree_easy_scan(pseudo_opcode_tree, &node_body, GlobalDynaBuf))
|
if ((tree_easy_scan(pseudo_opcode_tree, &node_body, GlobalDynaBuf))
|
||||||
&& node_body) {
|
&& node_body) {
|
||||||
@ -1508,9 +1508,9 @@ void pseudoopcode_parse(void) // now GotByte = '!' (or '.' in case of --fullstop
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (then == SKIP_REMAINDER)
|
if (then == SKIP_REMAINDER)
|
||||||
input_skip_remainder();
|
parser_skip_remainder();
|
||||||
else if (then == ENSURE_EOS)
|
else if (then == ENSURE_EOS)
|
||||||
input_ensure_EOS();
|
parser_ensure_EOS();
|
||||||
// the other two possibilities (PARSE_REMAINDER and AT_EOS_ANYWAY)
|
// the other two possibilities (PARSE_REMAINDER and AT_EOS_ANYWAY)
|
||||||
// will lead to the remainder of the line being parsed by the mainloop.
|
// will lead to the remainder of the line being parsed by the mainloop.
|
||||||
}
|
}
|
||||||
@ -1526,14 +1526,14 @@ void notreallypo_setpc(void) // GotByte is '*'
|
|||||||
|
|
||||||
// next non-space must be '='
|
// next non-space must be '='
|
||||||
NEXTANDSKIPSPACE();
|
NEXTANDSKIPSPACE();
|
||||||
if (!input_expect('='))
|
if (!parser_expect('='))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
ALU_defined_int(&intresult); // read new address
|
ALU_defined_int(&intresult); // read new address
|
||||||
// check for modifiers
|
// check for modifiers
|
||||||
while (input_accept_comma()) {
|
while (parser_accept_comma()) {
|
||||||
// parse modifier. if no keyword given, give up
|
// parse modifier. if no keyword given, give up
|
||||||
if (input_read_and_lower_keyword() == 0)
|
if (parser_read_and_lower_keyword() == 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (strcmp(GlobalDynaBuf->buffer, "overlay") == 0) {
|
if (strcmp(GlobalDynaBuf->buffer, "overlay") == 0) {
|
||||||
@ -1584,9 +1584,9 @@ void notreallypo_setpc(void) // GotByte is '*'
|
|||||||
if (do_outfilestart)
|
if (do_outfilestart)
|
||||||
po_outfilestart();
|
po_outfilestart();
|
||||||
|
|
||||||
input_ensure_EOS();
|
parser_ensure_EOS();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
input_skip_remainder();
|
parser_skip_remainder();
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#define RELEASE "0.97" // update before release FIXME
|
#define RELEASE "0.97" // update before release FIXME
|
||||||
#define CODENAME "Zem" // update before release
|
#define CODENAME "Zem" // update before release
|
||||||
#define CHANGE_DATE "28 Jul" // update before release FIXME
|
#define CHANGE_DATE "29 Jul" // update before release FIXME
|
||||||
#define CHANGE_YEAR "2024" // update before release
|
#define CHANGE_YEAR "2024" // update before release
|
||||||
//#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/"
|
//#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/"
|
||||||
#define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME
|
#define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME
|
||||||
|
Loading…
x
Reference in New Issue
Block a user