From 78ad4134ccb75fe29307e42de2a9f233f9f7aacd Mon Sep 17 00:00:00 2001 From: Whiteknight Date: Tue, 20 Oct 2009 21:30:51 -0400 Subject: [PATCH] add some comments and TODO notes in matrixy.pir for thigns that need to change --- matrixy.pir | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/matrixy.pir b/matrixy.pir index eacaebc..cde8694 100644 --- a/matrixy.pir +++ b/matrixy.pir @@ -44,24 +44,39 @@ object. '__initglobals'() .end +# TODO: This function is an initialization step for the parser. We should +# initialize the parser so that state is not stored from one parse +# to the next. Find a way to add this automatically into the +# HLLCompiler object .sub '__initglobals' + # Parser data fields that we use to keep track of blocks $P0 = new 'ResizablePMCArray' set_hll_global ['Matrixy';'Grammar';'Actions'], '@?BLOCK', $P0 $P0 = new 'Undef' set_hll_global ['Matrixy';'Grammar';'Actions'], '$?BLOCK', $P0 + # list of functions that we've compiled. We cache them to prevent needing + # to recompile. + # TODO: This isn't part of the parser, find a better namespace to hold this $P1 = new 'Hash' set_hll_global ['Matrixy';'Grammar';'Actions'], '%?FUNCTIONS', $P1 + # TODO: This isn't part of the parser, find a better namespace to hold this + # TODO: !dispatch to "path()" to do this. # default path is set to current directory $P2 = new 'ResizablePMCArray' $P2[0] = "." $P2[1] = "toolbox/" set_hll_global ['Matrixy';'Grammar';'Actions'], '@?PATH', $P2 + # list of global variables defined with the "global" keyword $P3 = new 'Hash' set_hll_global ['Matrixy';'Grammar';'Actions'], '%?GLOBALS', $P3 + # TODO: We need a much better way to handle NARGIN. Might want to use + # :call_sig and process all our own arguments + # list to keep track of arguments to a function so we can populate + # NARGIN. $P0 = new 'ResizablePMCArray' set_hll_global['Matrixy';'Grammar';'Actions'], '@?PARAMS', $P0 .end @@ -76,6 +91,8 @@ to the Matrixy compiler. .sub 'main' :main .param pmc args + # TODO: We might want to add this sequence as a method on the compiler + # object, so we can call it from a library load too. # load start up file $P0 = null '!dispatch'('matrixyrc', $P0, 1, 1, 1) @@ -84,13 +101,12 @@ to the Matrixy compiler. $P1 = $P0.'command_line'(args) .end -.include 'src/gen_internals.pir' -.include 'src/gen_builtins.pir' -.include 'src/gen_grammar.pir' -.include 'src/gen_actions.pir' - =back =cut +.include 'src/gen_internals.pir' +.include 'src/gen_builtins.pir' +.include 'src/gen_grammar.pir' +.include 'src/gen_actions.pir'