--- /dev/null
+/* script-debug.h - Debug handling matching memory loaded data to source locations
+ *
+ * Copyright (C) 2009 Charlie Brej <cbrej@cs.man.ac.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Written by: Charlie Brej <cbrej@cs.man.ac.uk>
+ */
+#include "script-debug.h"
--- /dev/null
+/* script-debug.h - Debug handling matching memory loaded data to source locations
+ *
+ * Copyright (C) 2009 Charlie Brej <cbrej@cs.man.ac.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Written by: Charlie Brej <cbrej@cs.man.ac.uk>
+ */
+#ifndef SCRIPT_DEBUG_H
+#define SCRIPT_DEBUG_H
+
+
+typedef struct
+{
+ int line_index;
+ int column_index;
+} script_debug_source_location_t;
+
+
+#endif /* SCRIPT_DEBUG_H */
const char *expected)
{
ply_error ("Parser error L:%d C:%d : %s\n",
- token->line_index,
- token->column_index,
+ token->location.line_index,
+ token->location.column_index,
expected);
}
ply_list_append_data (op_list, op_first);
ply_list_append_data (op_list, op_for);
- script_op_t *op_block = script_parse_new_op_block (op_list)
+ script_op_t *op_block = script_parse_new_op_block (op_list);
return op_block;
}
curtoken = script_scan_get_next_token (scan);
#endif
- script_op_t *op = script_parse_new_op_exp (exp)
+ script_op_t *op = script_parse_new_op_exp (exp);
return op;
}
return NULL;
}
break;
}
- token->line_index = scan->line_index;
- token->column_index = scan->column_index;
+ token->location.line_index = scan->line_index;
+ token->location.column_index = scan->column_index;
nextchar = script_scan_get_next_char (scan);
if (ply_bitarray_lookup (scan->identifier_1st_char, curchar))
#ifndef script_scan_H
#define script_scan_H
+#include "script-debug.h"
#include "ply-bitarray.h"
#include <stdbool.h>
double floatpoint;
} data;
int whitespace;
- int line_index;
- int column_index;
+ script_debug_source_location_t location;
} script_scan_token_t;
typedef struct