Parsing Non-LK( k ) Grammars with Yacc
نویسنده
چکیده
Of the parser generating tools currently in use, yacc (or one of its several variants) is perhaps the most frequently employed. However, because of inherent ambiguities there are some languages (such as C++) that a yacc-generated parser cannot successfully compile. This paper describes a set of minor modifications to yacc-like tools that allows them to be used in a straightforward way to parse ambiguities and, more generally, grammars that require an indefinite amount of lookahead. Required changes to the lexical analyzer are also discussed, and the application of these techniques is illustrated within the context of specific examples.
منابع مشابه
The G rammar D eployment K it — System Demonstration — Jan Kort
Grammar deployment is the process of turning a given grammar specification into a working parser. The Grammar Deployment Kit (for short, GDK) provides tool support in this process based on grammar engineering methods. We are mainly interested in the deployment of grammars for software renovation tools, that is, tools for software reand reverse engineering. The current version of GDK is optimize...
متن کاملUsing Linear Positional Grammars for the LR Parsing of 2-D Symbolic Languages
In this paper we present a grammar formalism for the generation and parsing of two-dimensional symbolic languages. Linear Positional Grammars (or LPGs for short) are an immediate generalization of the context-free string grammars. Through the use of general spatial relations they allow the definition of pictures whose symbols span on a two-dimensional space. Due to their analogy to context-free...
متن کاملYtracc: a Parse Browser for Yacc Grammars
We describe a program for the display and exploration of complex, domain-specific information: ytracc, an interactive grammar debugging tool for compiler writers. The ytracc system provides the designer of a yacc grammar a method of tracing a parser as it uses the grammar. ytracc captures the states of the parse as it is carried out. The captured parse can then be replayed forwards or backwards...
متن کاملANTLR: A Predicated- LL(k) Parser Generator
Despite the parsing power of LR=LALR algorithms, e.g. YACC 1, programmers often choose to write recursive-descent parsers by hand to obtain increased flexibility, better error handling, and ease of debugging. We introduce ANTLR, a public-domain parser generator that combines the flexibility of hand-coded parsing with the convenience of a parser generator, which is a component of PCCTS 2. ANTLR ...
متن کاملA Parsing Methodology for the Implementation of Visual Systems
The Visual Language Compiler-Compiler (VLCC) is a grammar-based graphical system for the automatic generation of visual programming environments. In this paper the theoretical and algorithmic issues of VLCC are discussed in detail. The parsing methodology we present is based on the “positional grammar” model. Positional grammars naturally extend context-free grammars by considering new relation...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Softw., Pract. Exper.
دوره 23 شماره
صفحات -
تاریخ انتشار 1993