2014 · 10 citations · 14 references
ComputingComputer ScienceCompilersNatural Language ProcessingProgramming LanguagesGrammarParsingSyntactic AnalysisSyntax AnalysisSyntax ParsingType SystemsExpression ParsingGrammar FormalismsOperator Precedence ParsingOperatorsParsing AlgorithmsParsing Expression GrammarsPrecedence RulesStatic Type Checking
This paper proposes new composable user-defined operators, named protean operators. They can express various language extensions including user-defined literals such as regular expression literals as well as user-defined expressions. Their expressiveness is equivalent to Parsing Expression Grammar (PEG). The operators have two important features to be parsed in pragmatic time: overloading by return type and a precedence rule for operators. They can be parsed efficiently even if they express user-defined literals since ambiguities in the grammar are removed by these two features. The overloading by return type enables us to consider static types as non-terminal symbols in the grammar. The compiler can use static type information for parsing. It can resolve ambiguities of the rules with the same syntax but a different type. Protean operators with the same return type require programmers to declare the precedence among them. These precedence rules enable completely removing ambiguities from the grammar since all the rules applicable to the same place are ordered. Thus, the expressions including protean operators can be parsed in pragmatic time. We have implemented a language that is a subset of Java but supports protean operators. We present an experiment to show that the programs including user-defined literals cannot be parsed in pragmatic time in existing approaches but can be efficiently parsed in our approach.
14
Semantics of context-free languages
Donald E. Knuth · Theory of Computing Systems · 1968 · 2K citations
Maude: specification and programming in rewriting logic
Manuel Clavel, Francisco Durán, Steven Eker et al. · Theoretical Computer Science · 2002 · 772 citations · Full text
Template meta-programming for Haskell
Tim Sheard, Simon Peyton Jones · 2002 · 548 citations
Bryan Ford · 2004 · 409 citations
Computing, Computer Science, Natural Language Processing +16
Martin Bravenboer, Eelco Visser · 2004 · 209 citations