DOI QR코드

DOI QR Code

A One-Gap Parsing with Extended PLR(1) Grammars

확장된 PLR(1) 문법에 대한 단일 틈 파싱

  • Received : 2014.10.06
  • Accepted : 2015.01.12
  • Published : 2015.03.15

Abstract

Gap parsing is an algorithm for parsing incomplete input strings which include some gaps. Gap parsing is different from conventional parsing, and as known results, one-gap parsing algorithms for arbitrary context-free grammar and LL(1) grammar have $O(n^3)$ and $O(n^2)$ time complexity, respectively. This paper presents a one-gap parsing algorithm for extended PLR(1) grammars. Extended PLR(1) grammars are the class of grammars smaller than LR(1) but much larger than LL(1). The one-gap parsing algorithm of the grammar class is shown to have the time complexity of $O(n^2)$, which is equal to the complexity of one-gap parsing algorithms for LL(1) grammars.

틈(Gap) 파싱은 완전하지 않고 틈이 있는 입력 스트링에 대한 구문 분석을 수행한다. 이런 틈 파싱에 관한 기존 연구로서 임의의 문법에 대한 단일 틈 파싱 알고리즘과 LL(1) 문법에 대한 단일 틈 파싱 알고리즘이 제안되었으며, 이들의 시간복잡도는 각각 $O(n^3)$$O(n^2)$이다. 본 논문에서는 확장된 PLR(1) 문법에 대한 단일 틈 파싱 알고리즘을 제안한다. 확장된 PLR(1) 문법은 LR(1) 문법의 부분 클래스이지만 LL(1) 문법보다는 휠씬 넒은 범위의 문법 클래스이다. 이 문법 클래스에 대한 단일 틈 파싱 알고리즘이 LL(1) 문법에 대한 기존에 알려진 단일 틈 파싱 알고리즘의 복잡도와 동일한 $O(n^2)$임을 보인다.

Keywords

Acknowledgement

Supported by : 한신대학교

References

  1. E. Bertsch and M.-J. Nederhof, "Gap parsing with LL(1) grammars," Grammars, Vol. 8, pp. 1-16, 2005.
  2. E. Bertsch, "An asymptotically optimal algorithm for non-correcting LL(1) error recovery," Bericht nr. 176, Fakultat fur Mathematik, Ruhr-Universitat Bochum, Apr. 1994.
  3. H. Richter, "Noncorrecting syntax error recovery," ACM Transactions on Programming Languages and Systems, Vol. 7, No. 3, pp. 478-489, Jul. 1985. https://doi.org/10.1145/3916.4019
  4. G.V Cormack, "An LR substring parser for noncorrecting syntax error recovery," SIGPLAN Notices, Vol. 24, No. 7, pp. 161-169, 1989. https://doi.org/10.1145/74818.74832
  5. B. van Deudekom and P. Kooiman, "Top-down noncorrecting error recovery in LLgen," Report IR-338, Vrije Universiteit Amsterdam, 1993.
  6. J. Bates and A. Lavie, "Recognizing substrings of LR(k) languages in linear time," ACM Transactions on Programming Languages and Systems, Vol. 16, No. 3, pp. 1051-1077, 1994. https://doi.org/10.1145/177492.177768
  7. M.-J. Nederhof and E. Bertsch, "Linear-time suffix parsing for deterministic languages," Journal of the ACM, Vol. 43, No. 3, pp. 524-554, 1996. https://doi.org/10.1145/233551.233555
  8. G.-O. Lee and K.-M. Choe, "A powerful LL(k) covering transformation," SIAM J. Computing, Vol. 35, No. 2, pp. 359-377, 2006. https://doi.org/10.1137/S0097539701400154
  9. G.-O. Lee, "Grammar classes generating single state parsing automata," Journal of KIISE: Software and Applications, Vol. 41, No. 7, pp. 518-522, 2014. (in Korean)
  10. D. E. Knuth, "On the translation of languages from left to right," Information and Control, Vol. 8, pp. 607-623, 1965. https://doi.org/10.1016/S0019-9958(65)90426-2
  11. A.V. Aho and J.D. Ullman, The Theory of Parsing, Translation and Compiling, Vols. 1 & 2, Prentice- Hall, Englewood Cliffs, NJ, 1972, 1973.
  12. S. Sippu and E. Soisalon-Soininen, Parsing Theory, Vols. I & II, Springer, Berlin, 1990.