| parrotcode: pir.y | |
| Contents | Compilers |

pir.y

This is a complete rewrite of the parser for the PIR language.
TODO: 1. [done 9/8/8] fix argument stuff related to the :named flag. 2. [done 9/8/8] fix parameter stuff 3. [done 17/8/8] clean up back-end a bit (refactoring, consting) 4. improve memory management (free it!) 5. test 6. [done 12/8/8] write vanilla register allocator 7. generate PBC, using Parrot_PackFile (and related) data structures. This needs linkage to libparrot, which seems to fail.

static constant *fold_i_i(yyscan_t yyscanner, int a, pir_math_operator op, int b)a op b and returns a constant node containing the result value.
Both a and b are integer values.static constant *fold_n_i(yyscan_t yyscanner, double a, pir_math_operator op, int b)fold_i_i,
except a is of type double.static constant *fold_i_n(yyscan_t yyscanner, int a, pir_math_operator op, double b)fold_i_i,
except b is of type double.static constant *fold_n_n(yyscan_t yyscanner, double a, pir_math_operator op, double b)fold_i_i,
except that both a and b are of type double.static constant *fold_s_s(yyscan_t yyscanner, char *a, pir_math_operator op, char *b)a op b,
where both a and b are strings.
Only the concatenation and comparison operators are implemented; other operators will result in an error.static int evaluate_n_n(double a, pir_rel_operator op, double b)a with b according to the relational operator op.
op can be <!=>,
<==>,
<,
<=,
> or >=.static int evaluate_s(char *s)static char *concat_strings(char *a, char *b)
|
|
|