| Christian Mossin. Partial evaluation of general parsers. In Proc. PEPM'93, Second ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 13--21, 1993. |
....in dynamic contexts and for dynamic values in potentially static contexts. We can view an eta redex as providing a syntactic representation of a binding time coercion, either from static to dynamic, or from dynamic to static. Eta expansion can also help ensure termination of a partial evaluator [5, 17, 18]. In the case of using eta expansion where the value is of disjoint sum type, the binding time improvement enables The Trick. Intuitively, The Trick is used to process dynamic choices of static values, i.e. when finitely many static values may occur in a dynamic context. Enumerating these ....
Christian Mossin. Partial evaluation of general parsers. In Proc. PEPM'93, Second ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 13--21, 1993.
....the rst kind of those described above. Calling eta expand s makes the 7.3 Some general advice on how to write source programs 57 new c static (Cl) This eta expansion is of the second kind of those described above. Eta expansion has been used for binding time improvements in a number of papers [Bon91a, BP93, Mos93]. The kind of reasoning in this section is central in the derivation of exact, one pass continuation passing style transformers [DF89, DF91] 7.3 Some general advice on how to write source programs 7.3.1 Mixing arities Higher order values of di erent arities should not be mixed as this makes ....
Christian Mossin. Partial evaluation of general parsers (extended abstract). In David Schmidt, editor, Symposium on Partial Evaluation and Semantics-Based Program Manipulation, PEPM'93, Copenhagen, Denmark, June 1993.
....the first kind of those described above. Calling eta expand s makes the 7.3 Some general advice on how to write source programs 57 new c static (Cl) This eta expansion is of the second kind of those described above. Eta expansion has been used for binding time improvements in a number of papers [Bon91a, BP93, Mos93]. The kind of reasoning in this section is central in the derivation of exact, one pass continuation passing style transformers [DF89, DF91] 7.3 Some general advice on how to write source programs 7.3.1 Mixing arities Higher order values of different arities should not be mixed as this makes ....
Christian Mossin. Partial evaluation of general parsers (extended abstract). In David Schmidt, editor, Symposium on Partial Evaluation and Semantics-Based Program Manipulation, PEPM'93, Copenhagen, Denmark, June 1993.
....1 for Rules 3 and 5. 2 As a corollary we get that even though eta expansion allows more static reductions to take place, specialization will terminate since types are finite. In another setting, eta expansion and generalization are used both to improve binding times and to ensure termination [6, 19, 20]. Future work includes finding an efficient implementation of the binding time analysis. 3.3 Examples 3.3.1 Higher order static values in dynamic contexts In Figure 4 we demonstrate that the new binding time analysis inserts the expected eta redex in the example program from Section 2.2. ....
Christian Mossin. Partial evaluation of general parsers. In Schmidt [25], pages 13--21.
....program transformation which reconciles generality with efficiency by providing automated specialization and optimization of programs. It has proven its usefulness in numerous areas ranging from the specialization of scientific computations [7,8,6] to specialization of general scanners and parsers [24,20], and to automatic compiler generation [17,2] Partial evaluation has been subject of a rapidly increasing activity over the past decade due to its recent advances both in theory and practice, see e.g. 9,13,18] For example, specializing scientific computation algorithms by partial evaluation may ....
Mossin C., Partial evaluation of general parsers. In: Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation. (Copenhagen, Denmark). 13-21, ACM Press 1993.
....to discard unneeded computations, ffl prevention of infinite specialization of LR transitionsfor the CPS based parser. We describe the most important applications of the above improvements. The generated parsers are compact and are either about as fast or faster than those presentedby Mossin [9]. His traditional stack basedparser requires substantialchanges in the representation of the stack, and thus the structure of the parsing algorithm. Furthermore, since the parse stack is a static value under dynamic control, specialization suffers from termination problems. These issues do not ....
....in such a way that the residual program does not contain superfluous operations on the dynamic input list and expands into a trielike test cascade for k 1. The very nature of the loop through the association list ensures the effect of grouping the default actions at the end of the tests. Mossin [9] achieved this effect only by a programming trick on a CPS version of the loop. The static loop to select the non terminal shift actions has a special property, by construction of the goto table: one of the tests in the loop is guaranteed to succeed, since a non terminal shift onA is only ....
[Article contains additional citation context not shown here]
MOSSIN, C. Partial evaluation of general parsers. In SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (June 1993), D. Schmidt, Ed.
....compilers. 2.2.1 Parser Generation Conceptually, a parser is a function that accepts as arguments a grammar and an input string and returns some by product of the construction of a derivation of the input string. It is straightforward to write such general parsers both for the LL and LR method [9, 19,20, 23]. Partially evaluating a general parser with respect to a static grammar yields highly efficient residual parsers with performance on par with hand tuned parser generators such as yacc or Bison [23] Additionally, the same partial evaluation technology automatically yields efficient parser ....
Christian Mossin. Partial evaluation of general parsers. In Symp. Partial Evaluation and Semantics-Based Program Manipulation '93, pages 13--21, Copenhagen, Denmark, June 1993. ACM.
.... and the continuation based implementation models, the generated LR parsers compare favorably with those generated by traditionally built parser generators such as Bison [Donnelly and Stallman 1995] as well as those produced by the partial evaluation of a stack based implementation presented by Mossin [Mossin 1993]. Table I. Size of specialized parsers for k = 1 (in cons cells) G Size (G) Mossin LR CPS LR SLR G 1 24 1608 652 1236 491 G 2 48 3751 2070 2999 1197 G 3 123 6181 5870 7294 2700 The two implementation models have different merits; while the direct style approach leads to more compact parsers, ....
....containing the token codes. Thus, all timings measure purely the parsing time. The timings indicate that the speed of our functional parsers is within a factor of 2 of (with direct style parsing) or surpasses (with the continuation based approach) those generated from the stack based approach by Mossin [Mossin 1993]. The imperative direct style version even surpasses those timings, and gets very close to the Bison generated parsers in speed. These results prove the practicability of our approach. Moreover, we have used the continuation based parser generator to develop the front end of an ANSI C compiler ....
[Article contains additional citation context not shown here]
Mossin, C. 1993. Partial evaluation of general parsers. In D. Schmidt (Ed.), Proc. ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation PEPM '93, Copenhagen, Denmark, pp. 13--21. ACM Press.
....Rules 3 and 5. As a corollary we get that even though eta expansion allows more static reductions to take place, specialization will terminate since types are finite. In another setting, eta expansion and generalization are used both to improve binding times and to ensure termination [6] 19] [20]. Future work includes finding an efficient implementation of our binding time analysis. 3.3. Examples 3.3.1. Higher order static values in dynamic contexts We now demonstrate that the new binding time analysis inserts the expected etaredex in the example program (f:f g f) a:a from Section 2.2. ....
Christian Mossin. Partial evaluation of general parsers. In Schmidt [25], pages 13--21.
....This, however, has the unfortunate effect that, since the grammar is stored on the stack, it too becomes dynamic. The result is that no speedup can be obtained by partial evaluation. It is not obvious that the program can be rewritten to avoid this problem (unless one uses continuations like in [Mos93], but that is a major rewrite, and not an option if the language does not support higher order functions) We take a closer look at why the generalizing the stack causes the grammar to be dynamic. When handling the sequence operator, the parser pushes a part of the grammar on the stack, using the ....
....of the original type. The trick of generalizing unbounded structures only at particular places, guarded by constructors like GENERALIZE and GENERALIZED corresponds closely to a similar trick which is used to generalize continuations in Similix, where the guards are eta conversions ( Bon91] [Mos93]) 9 Conclusion and further work I first got the idea of constructor specialization in 1987 when I was writing an interpreter for a functional language in a term rewrite language. This interpreter used a stack and partial evaluatially evaluating it caused the same problems with unbounded stacks ....
[Article contains additional citation context not shown here]
C. Mossin. Partial evaluation of general parsers. In PEPM '93: ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, New York: ACM, 1993.
....to discard unneeded computations, ffl prevention of infinite specialization of LR transitions for the CPS based parser. We describe the most important applications of the above improvements. The generated parsers are compact and are either about as fast or faster than those presented by Mossin [12]. His traditional stack based parser requires substantial changes in the representation of the stack, and thus the structure of the parsing algorithm. Furthermore, since the parse stack is a static data structure under dynamic control, specialization suffers from termination problems. These issues ....
....test cascade for k 1. The very nature of the loop through the association list ensures the effect of grouping the default actions at the end of the tests. Section 4 shows the corresponding code in the CPS based parser along with residual code generated by the specializer. The solution in [12] requires a programming trick on a CPS version of the loop to achieve the same effect. The static loop to select the nonterminal shift actions (in shift items on symbol) has a special property, by construction of the goto table: one of the tests in the loop is guaranteed to succeed, since a ....
[Article contains additional citation context not shown here]
MOSSIN, C. Partial evaluation of general parsers. In Symposium on Partial Evaluation and Semantics-Based Program Manipulation '93 (Copenhagen, Denmark, June 1993), D. Schmidt, Ed., pp. 13--21.
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC