summaryrefslogtreecommitdiff
path: root/src/bytecode.c
Commit message (Collapse)AuthorAgeFilesLines
* moved source files into commit repositoryAdrian Thurston2020-03-141-0/+5025
|
* moved the original colm src dir to /colmAdrian Thurston2019-09-081-4938/+0
|
* pushing the trim decision to run-timeAdrian Thurston2019-05-241-9/+47
| | | | | | | | | The trim and no-trim operators are both now in the expression. In places where we want the print mechanism to decide if it trims or not, we lift the trim operator out of the expression and into the send expression, then pass it to the print and send instructions. This way the stream or input (parser) can control the trim (auto_trim feature) with the expression overriding the default.
* added a get option to retrieve auto_trim from bytecodeAdrian Thurston2019-05-231-4/+7
|
* added and auto_trim flag to stream anad inputAdrian Thurston2019-05-221-1/+25
| | | | | When set to true, all tree prints to the stream or sends to the input will result in a trim. Achieved by passing trim to the generic print.
* make tree_to_str available in the libraryAdrian Thurston2018-12-121-19/+0
|
* make location file name and column available in Colm codeAdrian Thurston2018-12-021-6/+30
|
* some cleanup of eof interfaceAdrian Thurston2018-07-101-2/+2
| | | | | Still have two bools concerning eof. Can't unify these yet ... need break down the two concepts to try to unify.
* improvements to free bytecodes, bytecode def cleanupAdrian Thurston2018-07-101-8/+8
|
* use FN_ prefix for functions, space is diff from IN_Adrian Thurston2018-07-101-146/+143
|
* more separation of input and streamAdrian Thurston2018-07-101-5/+5
|
* removed parser from input, initting with input takes pointer to input_tAdrian Thurston2018-07-091-16/+1
|
* don't supply pda_run to input->pull, breaking input->parser linkAdrian Thurston2018-07-091-6/+2
|
* REDUCE_COMMIT needs to use parser_tAdrian Thurston2018-07-091-3/+3
|
* use parser, not input, in the send instructionsAdrian Thurston2018-07-091-122/+101
|
* select between parser/plain stream at compile time, switch to "_"Adrian Thurston2018-07-091-64/+46
| | | | | | | | | Now that we have multiple parser using the same stream it is not responsible to set a pointer to parser from stream and rely on that to decide where to send (or to check if it is a simple stream). Back to making the decision at compile time. Also switching from "stds" to "_".
* some more separation of stream_t and input_tAdrian Thurston2018-07-091-91/+92
|
* separating the input from stream typeAdrian Thurston2018-07-081-76/+76
|
* make it possible to set parser input before parsingAdrian Thurston2018-07-071-1/+22
| | | | | | | | | Make it possible to set the parser input (sourced from some other parser) the same way the parser context is set. Previously would "send" the input the same way a stream was sent, but this was inconsistent with how the system operates. The "send" of an input was actually a hack that replaced the input. We are not supporting recursing input structures. Just an input and underneath that possibly some streams or data.
* reusing stream impls when parsing from 'input'Adrian Thurston2018-07-041-0/+16
| | | | | | | | To detect parsing from a top level input and to avoid appending it to a parser's top level (thus creating a tree), added a new type for input so we can replace the parser's top level. This change forces us to a two level structure where stream seq is at the top and stream data underneath. Requires us to hack the destructor so that we don't multiple delete the stream impl.
* balancing pushes and pullsAdrian Thurston2018-06-251-0/+7
|
* added colm_program as an arg to input functionsAdrian Thurston2018-06-251-16/+16
| | | | need this to perform input logging
* added close_stream to stream funcsAdrian Thurston2018-06-181-4/+1
|
* added print_tree to stream funcsAdrian Thurston2018-06-181-8/+2
| | | | | Selects between file and collect. Will want to also ensure only called on a "data" stream_impl.
* added stream funcs for collect and flushAdrian Thurston2018-06-181-11/+15
|
* some cleanup of types and names in the input subsystemAdrian Thurston2018-06-171-5/+5
|
* elimination of the PTR case from stream append/prependAdrian Thurston2018-06-171-19/+16
|
* pass prg to colm_tree_upref and maintian first struct idAdrian Thurston2018-06-151-94/+93
|
* merged the WC and WV versions of SEND TEXT, TREE, STREAMAdrian Thurston2018-05-151-102/+38
| | | | The SEND_EOF instruction was already in merged form.
* merged the PARSE_LOAD instruction into SENDAdrian Thurston2018-05-151-20/+29
|
* merged the EXIT instructions into PARSE_FRAGAdrian Thurston2018-05-151-42/+20
|
* merged PCR_CALL into PARSE_FRAG instructionsAdrian Thurston2018-05-151-62/+62
|
* removed stopId from parse frag instructionAdrian Thurston2018-05-151-20/+9
|
* unified parse frag and finishAdrian Thurston2018-05-151-79/+3
|
* verify operating on a parser in SEND_EOF instructionsAdrian Thurston2018-05-151-4/+6
|
* added an instruction for the final reduce commitAdrian Thurston2018-05-151-1/+11
| | | | | Was doing this in the parse finish instruction. Moving this out is the last change to make the frag and finish parses identical.
* init stop_id when a parser is constructedAdrian Thurston2018-05-141-4/+6
| | | | removed the setting of the stop_id from the parse_frag call
* use SEND_EOF instruction for setting and restoring EOF bitAdrian Thurston2018-05-141-8/+32
|
* don't use parse finish to pull out parse result, use dedeicated instructionAdrian Thurston2018-05-141-5/+1
| | | | Working towards unifying the parse frag and parse finish instructions.
* merged two cases in stream_append_textAdrian Thurston2018-05-141-12/+1
|
* sending trees: converted the TO_STR to a print inside the SEND_TEXTAdrian Thurston2018-05-141-4/+38
| | | | | Removed the convertion to a STR and implemented the send as text inside the SEND_TEXT instructions.
* cloned the SEND_TREE instruction as SEND_TEXTAdrian Thurston2018-05-131-0/+93
| | | | | Will use these for sending trees as text (default). SEND_TREE will be for the send_tree and parse_tree syntax.
* stringify when sending to streamsAdrian Thurston2018-05-131-2/+0
| | | | | | Since stream may be backed by parsers, we need to do this to mainain the send semantics, however it breaks indentation. Will need to alter the strategy to restore indentation.
* added a SEND_EOF instructionAdrian Thurston2018-05-131-0/+10
| | | | | | Gives us something to land on when we skip over parsing machinery before and EOS send. Also will try to use this to set EOF bit, hopefully allowing us to unify FRAG and FINISH parse operations.
* added stds, a list of streams, used for bare sendsAdrian Thurston2018-05-131-7/+43
|
* merged the WC and WV versions of parse instructionsAdrian Thurston2018-05-111-100/+31
|
* assert we always have an instruction to return to in PCR_RETAdrian Thurston2018-05-111-4/+1
|
* track at runtime if revert is enabledAdrian Thurston2018-05-111-1/+25
| | | | | | | This works for some instructions only. Sometimes we have revert enabled, but need to use non-revert instructions since the objects are local to the runtime stack. For other instructions we will take advantage of the availability of a revert state bit in order to simplify the implementation.
* stash exec->stream and exec->pcr on PCR callAdrian Thurston2018-05-101-74/+69
| | | | | | | We use these freely during code execution and parsing and save them on PCR call, as we do with other machine state. This makes all the parsing state vars more consistent with other VM vars and will allow us to simply the parsing instructions.
* stash steps on parse call, not beginning of parse sequenceAdrian Thurston2018-05-101-19/+29
|