Results 1 -
6 of
6
Parsing and Compiling Using Prolog
- ACM Transactions on Programming Languages and Systems
, 1987
"... This paper presents the material needed for exposing the reader to the advantages of using Prolog as a language for describing succinctly most of the algorithms needed in prototyping and implementing compilers or producing tools that facilitate this task. The available published material on the subj ..."
Abstract
-
Cited by 26 (2 self)
- Add to MetaCart
This paper presents the material needed for exposing the reader to the advantages of using Prolog as a language for describing succinctly most of the algorithms needed in prototyping and implementing compilers or producing tools that facilitate this task. The available published material on the subject describes one particular approach in implementing compilers using Prolog. It consists of coupling actions to recursive descent parsers to produce syntax-trees which are subsequently utilized in guiding the generation of assembly language code. Although this remains a worthwhile approach, there is a host of possibilities for Prolog usage in compiler construction. The primary aim of this paper is to demonstrate the use of Prolog in parsing and compiling. A second, but equally important, goal of this paper is to show that Prolog is a labor-saving tool in prototyping and implementing many non-numerical algorithms which arise in compiling, and whose description using Prolog is not available in the literature. The paper discusses the use of unification and nondeterminism in compiler writing as well as means to bypass these (costly) features when they are deemed unnecessary. Topics covered include bottom-up and top-down parsers, syntax-directed translation, grammar properties, parser generation, code generation, and optimixations. Newly proposed features that are useful in compiler construction are also discussed. A knowledge of Prolog is assumed.
A practical method for LR and LL syntactic error diagnosis and recovery
- ACM Transactions on Programming Languages and Systems
, 1987
"... This paper presents a powerful, practical, and essentially language-independent syntactic error diagnosis and recovery method that is applicable within the frameworks of LR and LL parsing. The method generally issues accurate diagnoses even where multiple errors occur within close proximity, yet sel ..."
Abstract
-
Cited by 14 (0 self)
- Add to MetaCart
This paper presents a powerful, practical, and essentially language-independent syntactic error diagnosis and recovery method that is applicable within the frameworks of LR and LL parsing. The method generally issues accurate diagnoses even where multiple errors occur within close proximity, yet seldom issues spurious error messages. It employs a new technique, parse action deferral, that allows the most appropriate recovery in cases where this would ordinarily be precluded by late detection of the error. The method is practical in that it does not impose substantial space or time overhead on the parsing of correct programs, and in that its time efficiency in processing an error allows for its incorporation in a production compiler. The method is language independent, but it does allow for tuning with respect to particular languages and implementations through the setting of language-specific parameters.
Are Efficient Natural Language Parsers Robust
- Eighth Australian Joint Conference on Artificial Intelligence
, 1995
"... This paper discusses the robustness of four efficient syntactic error-correcting parsing algorithms that are based on chart parsing with a context-free grammar. In this context, by robust we mean able to correct detectable syntactic errors. We implemented four versions of a bottom-up error-correctin ..."
Abstract
-
Cited by 4 (1 self)
- Add to MetaCart
This paper discusses the robustness of four efficient syntactic error-correcting parsing algorithms that are based on chart parsing with a context-free grammar. In this context, by robust we mean able to correct detectable syntactic errors. We implemented four versions of a bottom-up error-correcting chart parser: a basic bottom-up chart parser, and chart parsers employing selectivity, top-down filtering, and a combination of selectivity and a top-down filtering. The combined selectivity and top-down filtering parser was the most efficient. However, this parser failed to correctly repair more sentences than the other parsers, failing on 18 out of 119 ill-formed sentences, compared to no failures for the basic bottom-up chart parser. This paper examines trade-offs between parsing efficiency and robustness at the syntactic level.
Comparison of Syntactic Error Handling in LR Parsers
, 1995
"... this paper for a possible integration between incremental parsing and interactive recovery ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
this paper for a possible integration between incremental parsing and interactive recovery
Programming J.J. Homing Languages Editor Automatic Error Recovery for LR Parsers
"... In this paper we present a scheme for detecting and recovering from syntax errors in programs. The scheme, which is based on LR parsing, is driven by information which is directly and automatically obtainable from the information that is already present in an LR parser. The approach, which is patter ..."
Abstract
- Add to MetaCart
In this paper we present a scheme for detecting and recovering from syntax errors in programs. The scheme, which is based on LR parsing, is driven by information which is directly and automatically obtainable from the information that is already present in an LR parser. The approach, which is patterned after that of Levy and Graham and Rhodes, appears to provide error recovery which is both simple and powerful. Key Words and Phrases: programming languages, error correction, automatic correction, parsing, LR,
Appendix E
"... END" inserted to complete phrase started at line 19, column 1 expected after this token 11o Pascal2 Example 2 3. FOR K1 := TO NOELEMS DO X:=I ***Error: initial_value expected after this token 4. IF X=l THEN 6. WRITELN('O*END OF SORT*') ***Error: "END" inserted to complete phrase started at ..."
Abstract
- Add to MetaCart
END" inserted to complete phrase started at line 19, column 1 expected after this token 11o Pascal2 Example 2 3. FOR K1 := TO NOELEMS DO X:=I ***Error: initial_value expected after this token 4. IF X=l THEN 6. WRITELN('O*END OF SORT*') ***Error: "END" inserted to complete phrase started at line $, column 8 7. ELSE 8. WRITELN('O***LOOP DETECTED IN INPUT ORDER RELATIONS***'); 9. END. lO. ll. PROGRAM HUNTERINPUT,OUTPUT '? ***Error: program_heading expected instead 14. END. 15. 17. VAR I,PRIME,CHECK,NUMB:REAL,A:ARRAYI..6' OF REAL? ***Error: [ expected instead of this token ***Error: ] expected instead of this token 19. END. 20. 23. FOR I 1 TO 6 DO X:=l 24. END. 25. 28. CHECK: l? 111 30. WHILE CHECK)' PRIME DO X:=I < ...... > 31. END 32. END. 33. 35. VAR I:REAL; 36. CONST AE1] lO;A[2] 15;A[3] 25;A[4] 3;?A[5] 50;A[6] 75; ***Error: := expected after this token ***Error: := expected after this token ***Error: := expected after this token ***Error:

