Computational lambda-calculus and monads
Proceedings of the Fourth Annual Symposium on Logic in computer science
Control delimiters and their hierarchies
Lisp and Symbolic Computation
FPCA '89 Proceedings of the fourth international conference on Functional programming languages and computer architecture
Semantics of programming languages: structures and techniques
Semantics of programming languages: structures and techniques
Modern compiler implementation in Java
Modern compiler implementation in Java
Initial Algebra Semantics and Continuous Algebras
Journal of the ACM (JACM)
Science of Computer Programming - Special issue on mathematics of program construction
Proceedings of the sixth ACM SIGPLAN international conference on Functional programming
From control effects to typed continuation passing
POPL '03 Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Definitional Interpreters for Higher-Order Programming Languages
Higher-Order and Symbolic Computation
Higher-Order and Symbolic Computation
Environments, Continuation Semantics and Indexed Categories
TACS '97 Proceedings of the Third International Symposium on Theoretical Aspects of Computer Software
Closed Freyd- and kappa-categories
ICAL '99 Proceedings of the 26th International Colloquium on Automata, Languages and Programming
Definitional interpreters for higher-order programming languages
ACM '72 Proceedings of the ACM annual conference - Volume 2
Rabbit: A Compiler for Scheme
Premonoidal categories and notions of computation
Mathematical Structures in Computer Science
Journal of Functional Programming
Combinator Parsing: A Short Tutorial
Language Engineering and Rigorous Software Development
Semantics-preserving Migration of Semantic Rules During Left Recursion Removal in Attribute Grammars
Electronic Notes in Theoretical Computer Science (ENTCS)
Typed Transformations of Typed Grammars: The Left Corner Transform
Electronic Notes in Theoretical Computer Science (ENTCS)
LL(*): the foundation of the ANTLR parser generator
Proceedings of the 32nd ACM SIGPLAN conference on Programming language design and implementation
Hi-index | 0.00 |
Parsers, whether constructed by hand or automatically via a parser generator tool, typically need to compute some useful semantic information in addition to the purely syntactic analysis of their input. Semantic actions may be added to parsing code by hand, or the parser generator may have its own syntax for annotating grammar rules with semantic actions. In this paper, we take a functional programming view of such actions. We use concepts from the semantics of mostly functional programming languages and adapt them to give meaning to the actions of the parser. Specifically, the semantics is inspired by the categorical semantics of lambda calculi and the use of premonoidal categories for the semantics of effects in programming languages. This framework is then applied to our leading example, the transformation of grammars to eliminate left recursion. The syntactic transformation of left-recursion elimination leads to a corresponding semantic transformation of the actions for the grammar. We prove the semantic transformation correct and relate it to continuation passing style, a widely studied transformation in lambda calculi and functional programming.