Skip to main content
Top

2018 | OriginalPaper | Chapter

Extended Context-Free Grammars Parsing with Generalized LL

Authors : Artem Gorokhov, Semyon Grigorev

Published in: Tools and Methods of Program Analysis

Publisher: Springer International Publishing

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Parsing plays an important role in static program analysis: during this step a structural representation of code is created upon which further analysis is performed. Parser generator tools, being provided with syntax specification, automate parser development. Language documentation often acts as such specification. Documentation usually takes form of ambiguous grammar in Extended Backus-Naur Form which most parser generators fail to process. Automatic grammar transformation generally leads to parsing performance decrease. Some approaches support EBNF grammars natively, but they all fail to handle ambiguous grammars. On the other hand, Generalized LL parsing algorithm admits arbitrary context-free grammars and achieves good performance, but cannot handle EBNF grammars. The main contribution of this paper is a modification of GLL algorithm which can process grammars in a form which is closely related to EBNF (Extended Context-Free Grammar). We also show that the modification improves parsing performance as compared to grammar transformation-based approach.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Appendix
Available only for authorised users
Literature
2.
go back to reference Aho, A.V., Hopcroft, J.E.: The Design and Analysis of Computer Algorithms. Pearson Education India (1974) Aho, A.V., Hopcroft, J.E.: The Design and Analysis of Computer Algorithms. Pearson Education India (1974)
6.
go back to reference Bruggemann-Klein, A., Wood, D.: The parsing of extended context-free grammars (2002) Bruggemann-Klein, A., Wood, D.: The parsing of extended context-free grammars (2002)
7.
go back to reference Brüggemann-Klein, A., Wood, D.: Balanced context-free grammars, hedge grammars and pushdown caterpillar automata. In: Extreme Markup Languages® (2004) Brüggemann-Klein, A., Wood, D.: Balanced context-free grammars, hedge grammars and pushdown caterpillar automata. In: Extreme Markup Languages® (2004)
8.
go back to reference Comon, H., Dauchet, M., Gilleron, R., Löding, C., Jacquemard, F., Lugiez, D., Tison, S., Tommasi, M.: Tree automata techniques and applications (2007) Comon, H., Dauchet, M., Gilleron, R., Löding, C., Jacquemard, F., Lugiez, D., Tison, S., Tommasi, M.: Tree automata techniques and applications (2007)
12.
go back to reference Hopcroft, J.: An n log n algorithm for minimizing states in a finite automaton. Technical report, DTIC Document (1971) Hopcroft, J.: An n log n algorithm for minimizing states in a finite automaton. Technical report, DTIC Document (1971)
13.
go back to reference Morimoto, S.-I., Sassa, M.: Yet another generation of LALR parsers for regular right part grammars. Acta Informatica 37(9), 671–697 (2001)MathSciNetCrossRefMATH Morimoto, S.-I., Sassa, M.: Yet another generation of LALR parsers for regular right part grammars. Acta Informatica 37(9), 671–697 (2001)MathSciNetCrossRefMATH
15.
go back to reference Ragozina, A.: GLL-based relaxed parsing of dynamically generated code. Masters thesis, SpBU (2016) Ragozina, A.: GLL-based relaxed parsing of dynamically generated code. Masters thesis, SpBU (2016)
16.
go back to reference Rekers, J.G.: Parser generation for interactive environments. PhD thesis, Universiteit van Amsterdam (1992) Rekers, J.G.: Parser generation for interactive environments. PhD thesis, Universiteit van Amsterdam (1992)
17.
go back to reference Scott, E., Johnstone, A.: GLL parsing. Electron. Notes Theoret. Comput. Sci. 253(7), 177–189 (2010)CrossRef Scott, E., Johnstone, A.: GLL parsing. Electron. Notes Theoret. Comput. Sci. 253(7), 177–189 (2010)CrossRef
18.
go back to reference Scott, E., Johnstone, A.: GLL parse-tree generation. Sci. Comput. Program. 78(10), 1828–1844 (2013)CrossRef Scott, E., Johnstone, A.: GLL parse-tree generation. Sci. Comput. Program. 78(10), 1828–1844 (2013)CrossRef
19.
go back to reference Scott, E., Johnstone, A.: Structuring the GLL parsing algorithm for performance. Sci. Comput. Program. 125, 1–22 (2016)CrossRef Scott, E., Johnstone, A.: Structuring the GLL parsing algorithm for performance. Sci. Comput. Program. 125, 1–22 (2016)CrossRef
20.
go back to reference Scott, E., Johnstone, A., Economopoulos, R.: BRNGLR: a cubic tomita-style GLR parsing algorithm. Acta Informatica 44(6), 427–461 (2007)MathSciNetCrossRefMATH Scott, E., Johnstone, A., Economopoulos, R.: BRNGLR: a cubic tomita-style GLR parsing algorithm. Acta Informatica 44(6), 427–461 (2007)MathSciNetCrossRefMATH
21.
go back to reference Tellier, I.: Learning recursive automata from positive examples. Revue des Sciences et Technologies de l’Information-Série RIA: Revue d’Intelligence Artificielle 20(6), 775–804 (2006) Tellier, I.: Learning recursive automata from positive examples. Revue des Sciences et Technologies de l’Information-Série RIA: Revue d’Intelligence Artificielle 20(6), 775–804 (2006)
22.
go back to reference Thompson, K.: Programming techniques: regular expression search algorithm. Commun. ACM 11(6), 419–422 (1968)CrossRefMATH Thompson, K.: Programming techniques: regular expression search algorithm. Commun. ACM 11(6), 419–422 (1968)CrossRefMATH
23.
go back to reference Wirth, N.: Extended backus-naur form (EBNF). ISO/IEC 14977:2996 (1996) Wirth, N.: Extended backus-naur form (EBNF). ISO/IEC 14977:2996 (1996)
Metadata
Title
Extended Context-Free Grammars Parsing with Generalized LL
Authors
Artem Gorokhov
Semyon Grigorev
Copyright Year
2018
DOI
https://doi.org/10.1007/978-3-319-71734-0_3

Premium Partner