summaryrefslogtreecommitdiff
path: root/src/bytecode.h
Commit message (Collapse)AuthorAgeFilesLines
* fix vm_pop_type for big-endian systemsAdrian Thurston2021-01-181-1/+1
| | | | | | | | | | | | Change the pop to cast the pointer and take the value using a pointer to the requested type, then return that tmp. Previously we were taking the value using the tree type, then casting the value. During the cast of the value the high bits are dropped, and that's where the value actually lives, when on a big-endian system. Didn't notice the problem on little-endian systems because it happens to work fine there. Fixes #126.
* various refcount fixesAdrian Thurston2021-01-031-4/+2
| | | | | | - added downref when undoing a tree push - using correct opcode for undoing pushing stream - added an upref when sending back ignored trees
* added with_ignore(tree) iteratorAdrian Thurston2020-12-231-0/+1
| | | | | | | | | | | | This is identical to the basic tree iterator, except it visits ignore tokens. This makes it possible to rewrite comments, albeit, primitively. Constructors for tokens don't work right. Though we can set the data field. The following code can be used to turn comments into newlines: for I1: comment in with_ignore(Flux) { I1.data = "\n" }
* moved source files into commit repositoryAdrian Thurston2020-03-141-0/+678
|
* moved the original colm src dir to /colmAdrian Thurston2019-09-081-678/+0
|
* pushing the trim decision to run-timeAdrian Thurston2019-05-241-0/+4
| | | | | | | | | 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 and auto_trim flag to stream anad inputAdrian Thurston2019-05-221-0/+2
| | | | | 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 location file name and column available in Colm codeAdrian Thurston2018-12-021-1/+3
|
* improvements to free bytecodes, bytecode def cleanupAdrian Thurston2018-07-101-19/+6
|
* use FN_ prefix for functions, space is diff from IN_Adrian Thurston2018-07-101-62/+62
|
* more separation of input and streamAdrian Thurston2018-07-101-1/+1
|
* use parser, not input, in the send instructionsAdrian Thurston2018-07-091-7/+7
|
* select between parser/plain stream at compile time, switch to "_"Adrian Thurston2018-07-091-0/+2
| | | | | | | | | 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 "_".
* separating the input from stream typeAdrian Thurston2018-07-081-1/+3
|
* make it possible to set parser input before parsingAdrian Thurston2018-07-071-0/+2
| | | | | | | | | 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/+2
| | | | | | | | 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.
* merged the WC and WV versions of SEND TEXT, TREE, STREAMAdrian Thurston2018-05-151-11/+8
| | | | The SEND_EOF instruction was already in merged form.
* merged the PARSE_LOAD instruction into SENDAdrian Thurston2018-05-151-3/+1
|
* merged the EXIT instructions into PARSE_FRAGAdrian Thurston2018-05-151-3/+0
|
* merged PCR_CALL into PARSE_FRAG instructionsAdrian Thurston2018-05-151-1/+0
|
* unified parse frag and finishAdrian Thurston2018-05-151-6/+0
|
* added an instruction for the final reduce commitAdrian Thurston2018-05-151-0/+2
| | | | | Was doing this in the parse finish instruction. Moving this out is the last change to make the frag and finish parses identical.
* use SEND_EOF instruction for setting and restoring EOF bitAdrian Thurston2018-05-141-1/+2
|
* cloned the SEND_TREE instruction as SEND_TEXTAdrian Thurston2018-05-131-7/+6
| | | | | Will use these for sending trees as text (default). SEND_TREE will be for the send_tree and parse_tree syntax.
* added a SEND_EOF instructionAdrian Thurston2018-05-131-0/+1
| | | | | | 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-0/+1
|
* merged the WC and WV versions of parse instructionsAdrian Thurston2018-05-111-8/+8
|
* track at runtime if revert is enabledAdrian Thurston2018-05-111-0/+1
| | | | | | | 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.
* parsing bytecodes now operate on stream, finding the parser behind itAdrian Thurston2018-05-081-1/+3
| | | | | | Idea with this is that all writing should be done on streams. If there is a parser behind the stream then that indicates we need to call into the parsing machinery to process what is being sent.
* some bytecode renamingAdrian Thurston2018-05-081-6/+6
|
* removed print statements, using only the send statementAdrian Thurston2018-05-071-7/+0
|
* made the postfix print into a functionAdrian Thurston2018-05-061-0/+1
|
* added xml() and xmlac(), which which collect xml to stringsAdrian Thurston2018-05-061-0/+3
| | | | | Going to eliminate the specialized print forms, instead opting for functions. Later on we can make these lazy.
* added gets() to parser, which returns the streamAdrian Thurston2018-05-051-0/+2
|
* replacing the void LEL with a keyword and TYPE_VOID (non-tree)Adrian Thurston2018-05-041-3/+2
| | | | | Using LEL was a hack to make it work quickly, usig a non-tree type is the proper solution.
* allow switching on production numbersAdrian Thurston2018-03-091-0/+2
| | | | | Added a form to case statements that accepts a production name instead of a pattern.
* updated Copyright yearsAdrian Thurston2018-03-041-1/+1
|
* added a read_reduce statement to call postfix reducerAdrian Thurston2017-07-271-0/+1
| | | | Triggers the generation of the reducer. Accepts a stream.
* started on a tree print in postfix notationAdrian Thurston2017-07-201-0/+1
| | | | | Postfix notation can be used as a streaming tree format as both an output and input.
* minor fixes: a missing cast, no comma at enum end, no redefined typedefsPeter Reijnders2016-12-191-4/+1
|
* migrated from GPLv2 to MIT licenseAdrian Thurston2016-12-131-17/+18
|
* an automated include convention improvement from Peter ReijndersAdrian Thurston2016-12-131-3/+4
|
* implemented a const-string define option -Ename=valAdrian Thurston2016-07-281-5/+16
|
* new stream objects can now collect text, accessible with ->tree (str type)Adrian Thurston2016-03-071-3/+3
| | | | | This is much faster than send to a line parser and then extracting the tree just to convert it to txt.
* added the $$ operator, which converts tree-to-str with attrsAdrian Thurston2015-12-151-0/+1
|
* put reducer code in its own file, use local parse tree poolAdrian Thurston2015-10-051-2/+1
|
* working on a commit that can execute reduction actionsAdrian Thurston2015-10-041-1/+2
| | | | | | First track if the result is used. If not, we can remove parse trees at commit points. This is also the time to execute reduction actions so we can load as we parse. Not currently enabled (by way of omitting setting of not-used bit).
* cleanup and simplification, generic elements and variousAdrian Thurston2015-06-131-2/+0
|
* some cleanup around the unified list and map genericsAdrian Thurston2015-06-081-4/+2
|
* more vmap implementationAdrian Thurston2015-06-051-0/+1
|