DOI QR코드

DOI QR Code

불완전 XML을 위한 파싱 방법

A Parsing Method for an Incomplete XML

  • 조경룡 (순천대학교 정보통신공학부) ;
  • 조성언 (순천대학교 정보통신공학부) ;
  • 박장우 (순천대학교 정보통신공학부)
  • 발행 : 2008.12.30

초록

대표적인 웹 문서의 표준인 XML은 문서의 구조와 내용을 기술하기 위해 태그로 이루어진 문법 구조를 갖는다. XML 문서 작성자는 XML 문서 작성 중 해당 XML DTD(Document Type Definition)에 문법적으로 올바르지 않은 문장을 입력할 수 있다. 즉, 일반적인 텍스트 에디터 환경에서 XML 문서에 입력되는 내용과 태그의 쌍은 완전하지 못한 형태로 입력될 수 있다. 문법적으로 불완전한 문장 입력은 사용자의 계속적인 편집 상태를 종료하고, 정상적인 파싱을 보장하지 않는 원인이 된다. XML 문서를 작성하는 과정에서 문법적으로 불완전한 문장 입력은 정상적인 파싱을 보장하지 않는다. 따라서, 에디터가 문법적으로 빠져있는 부분의 심볼이 무엇인지 정확히 인식 가능하고, 주어진 문법에 따라 부분적인 파스트리를 완성한다면, 사용자의 프로그래밍 편집 상태를 종료하지 않고 계속적인 편집과 성공적인 파싱을 보장할 수 있을 것이다. 본 논문은 XML 문서 편집기에 사용될 수 있는 XML 파서가 문법적으로 불충분한 문장의 입력에 대해 문법에 따라 빠진 부분을 인식하고, 누락된 문법 심벌을 찾아 부족한 부분 파스트리를 완성함으로써 사용자에게 성공적인 XML 문서 편집을 보장할 수 있는 파싱 방법을 제안한다. 제안된 파싱 방법을 통해 사용자는 프로그래밍 편집 중 문법 오류에 대한 부담을 줄일 수 있다. 또한, 사용자는 불완전 입력에 대해 일반적인 에러 처리에 따른 편집 중단 없이 계속적인 문서 파싱 을 보장받아 편집 효율을 높일 수 있다.

XML is one of standard web languages. XML has a syntax architecture consisted of tags, which are used to descript contents and structures of a XML document. In XML documents, missing of markup tag is one of common factors generating incomplete inputs. Usually, editors will recognize incomplete inputs as syntax errors. And so, when editors find them, they will highlight lines in which syntax errors happened, and execute appropriate error handling routines. But, there are no more parsing actions. In this paper, we propose a method to recognize incomplete input strings and keep parsing phases going. To recognize pars missed grammatically in incomplete inputs and create them newly, we use an expanding parsing table. It includes additional parsing actions for newly generated input symbols. Through the information, incomplete inputs will be completed and parsing steps will be finished successively. Therefore, users can be assured that they make always correct XML documents, even if inputs are incomplete, and can not be nervous about input faults.

키워드

참고문헌

  1. Aho, A.V., Sethi R., and Ullman J. D., Compilers: Principles, Techniques and Tools, Addison-Wesley, 1986
  2. Bates, J. and Lavie A.,"Recognizing Substring of LR(K) Languages in Linear Time", ACM TOPLAS, Vol.16, No.3, pp.1051-1077, 1994 https://doi.org/10.1145/177492.177768
  3. Grune D., Jacobs C., Parsing Techniques: A Practical Guide, Ellis Horwood Limited, 1998
  4. Jalili F. and Gallier J., "Building Friendly Parsers", Proceedings of 9th ACM POPL, pp.196-206, 1982
  5. Larchéveque J.M., "Optimal Incremental Parsing", ACM TOPLAS, Vol.17 ,No.1, pp.1-15, 1995 https://doi.org/10.1145/200994.200996
  6. Nozohoor-Farshi R., "GLR parsing for -grammars.", Generalized LR Parsing, pp.61-75, Kluwer Academic Pubkishers, 1991
  7. Reckers J. and Koorn W., "Substring parsing for arbitrary context-free grammars" ACM SIGPLAN Notices,, 26(5), pp.59-66, 1991
  8. Snelting G., "How to build LR parsers which accept incomplete input", ACM SIGPLAN Notices, vol. 25, no. 4, pp.83-89, 1990 https://doi.org/10.1145/987481.987489
  9. Wagner A., and Graham S., "Incremental analysis of real programing languages.", Proceedings of ACM PLDI '97, 1997