summaryrefslogtreecommitdiff
path: root/src/synthesis.cc
Commit message (Collapse)AuthorAgeFilesLines
* various refcount fixesAdrian Thurston2021-01-031-1/+0
| | | | | | - 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/+18
| | | | | | | | | | | | 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" }
* renamed DefList and LelDefList to the more accurate ProdList, LelProdListAdrian Thurston2020-04-121-2/+2
|
* moved source files into commit repositoryAdrian Thurston2020-03-141-0/+3370
|
* moved the original colm src dir to /colmAdrian Thurston2019-09-081-3362/+0
|
* pushing the trim decision to run-timeAdrian Thurston2019-05-241-5/+43
| | | | | | | | | 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.
* improvements to free bytecodes, bytecode def cleanupAdrian Thurston2018-07-101-1/+1
|
* use FN_ prefix for functions, space is diff from IN_Adrian Thurston2018-07-101-6/+6
|
* more separation of input and streamAdrian Thurston2018-07-101-1/+1
|
* use parser, not input, in the send instructionsAdrian Thurston2018-07-091-19/+5
|
* select between parser/plain stream at compile time, switch to "_"Adrian Thurston2018-07-091-2/+59
| | | | | | | | | 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 "_".
* make it possible to set parser input before parsingAdrian Thurston2018-07-071-125/+156
| | | | | | | | | 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-2/+12
| | | | | | | | 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.
* make the rhs of switch vars available in case clausesAdrian Thurston2018-05-201-0/+5
|
* merged the WC and WV versions of SEND TEXT, TREE, STREAMAdrian Thurston2018-05-151-36/+12
| | | | The SEND_EOF instruction was already in merged form.
* merged the PARSE_LOAD instruction into SENDAdrian Thurston2018-05-151-1/+0
|
* merged the EXIT instructions into PARSE_FRAGAdrian Thurston2018-05-151-1/+0
|
* merged PCR_CALL into PARSE_FRAG instructionsAdrian Thurston2018-05-151-1/+0
|
* removed stopId from parse frag instructionAdrian Thurston2018-05-151-3/+0
|
* unified parse frag and finishAdrian Thurston2018-05-151-16/+4
|
* added an instruction for the final reduce commitAdrian Thurston2018-05-151-0/+4
| | | | | 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-0/+2
| | | | 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-3/+3
|
* don't issue parse finish instructions if parse stop enabledAdrian Thurston2018-05-141-2/+4
|
* removed TREE_TO_STR from evaluateParseAdrian Thurston2018-05-141-6/+0
|
* don't TRIM trees in parse and embed-stringAdrian Thurston2018-05-141-2/+2
| | | | makes these operations consistent with send
* sending trees: converted the TO_STR to a print inside the SEND_TEXTAdrian Thurston2018-05-141-6/+0
| | | | | 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-2/+14
| | | | | 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/+2
| | | | | | 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-2/+5
| | | | | | 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/+10
|
* allow sending to lists of streamsAdrian Thurston2018-05-121-0/+7
|
* merged the WC and WV versions of parse instructionsAdrian Thurston2018-05-111-32/+12
|
* don't disable parse revert based on what's being manpiulatedAdrian Thurston2018-05-111-5/+5
| | | | Other tests always cause this to come out non-disabled anyways.
* moved all the parse finish codegen to one functionAdrian Thurston2018-05-091-64/+40
|
* parsing bytecodes now operate on stream, finding the parser behind itAdrian Thurston2018-05-081-6/+15
| | | | | | 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-8/+8
|
* removed print statements, using only the send statementAdrian Thurston2018-05-071-123/+0
|
* don't convert to a string when sending a tree to a streamAdrian Thurston2018-05-071-2/+1
| | | | | Was not getting proper indentation and this was the reason why. No indent when converting to a stream.
* allow sending to streams via IN_PARSE_APPEND_WCAdrian Thurston2018-05-071-1/+2
| | | | | | Moving to a single instrauction set for streams and parser, allowing us to interchange them at runtime. Can replace stdout with a stream that is in front of a parser.
* replacing the void LEL with a keyword and TYPE_VOID (non-tree)Adrian Thurston2018-05-041-4/+4
| | | | | Using LEL was a hack to make it work quickly, usig a non-tree type is the proper solution.
* don't downref values of void typeAdrian Thurston2018-05-041-5/+5
|
* removed a couple downrefs of parsers and streamsAdrian Thurston2018-05-031-1/+1
| | | | | | | | | These were left over from the when these structures were trees and not the current incarnation of structs (plain values). Fixex a bug reported a several times. refs #247. http://www.colm.net/pipermail/colm-users/2018-April/000187.html http://www.colm.net/pipermail/colm-users/2017-June/000175.html
* allow a prod-name case clause to also have a patternAdrian Thurston2018-03-111-0/+20
|
* allow switching on production numbersAdrian Thurston2018-03-091-2/+28
| | | | | 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-2/+35
| | | | Triggers the generation of the reducer. Accepts a stream.
* started on a tree print in postfix notationAdrian Thurston2017-07-201-0/+6
| | | | | Postfix notation can be used as a streaming tree format as both an output and input.
* migrated from GPLv2 to MIT licenseAdrian Thurston2016-12-131-17/+19
|
* an automated include convention improvement from Peter ReijndersAdrian Thurston2016-12-131-5/+4
|