Skip to content

Commit

Permalink
add some comments and TODO notes in matrixy.pir for thigns that need …
Browse files Browse the repository at this point in the history
…to change
  • Loading branch information
Whiteknight committed Oct 21, 2009
1 parent 9e45f20 commit 78ad413
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions matrixy.pir
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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'

0 comments on commit 78ad413

Please sign in to comment.