Skip to main content
Log in

A general parsing algorithm with context matching for context-sensitive graph grammars

  • 1191: Sentient Multimedia Systems
  • Published:
Multimedia Tools and Applications Aims and scope Submit manuscript

Abstract

Context-sensitive graph grammars have been intuitive and rigorous formalisms for specifying visual programming languages, as they are sufficient expressive and equipped with parsing mechanisms. Parsing has been a fundamental issue in the research of context-sensitive graph grammars. However, the existent parsing algorithms are either inefficient or confined to a minority of graph grammars. This paper proposes a general parsing algorithm with two embedded strategies, context matching and production-set partitioning. The two strategies can greatly narrow down the search space of redexes and thus significantly improve parsing efficiency, even though the worst-case time complexity is not theoretically reduced. Moreover, a detailed case study and an experiment are provided accordingly to demonstrate the paring process and performance of the proposed algorithm.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

References

  1. Bottoni P, Taentzer G, Schürr A (2000) Efficient parsing of visual languages based on critical pair analysis and contextual layered graph transformation. IEEE symposium on visual languages 59–60

  2. Chen L, Huang L, Chen L (2015) Breeze graph grammar: a graph grammar approach for modeling the software architecture of big data-oriented software systems. Softw: Pract Exper 45(8):1023–1050

  3. Costagliola G, Deufemia V, Polese G, Risi M (2005) Building syntax-aware editors for visual languages. J Vis Lang Comput 16(6):508–540

    Article  Google Scholar 

  4. Costagliola G, Deufemia V, Polese G (2007) Visual language implementation through standard compiler-compiler techniques. J Vis Lang Comput 18(2):165–226

    Article  Google Scholar 

  5. Costagliola G, Rosa M, Minas M (2019) Visual parsing and parser visualization. IEEE symposium on visual languages and human-centric computing 243–247

  6. Ehrig H, Kreowski HJ, Montanari U, Rozenberg G (eds) (1999) Handbook of graph grammars and computing by graph transformation 3: concurrency, parallelism, and distribution. World Scientific

  7. Engels G, Kreowski HJ, Rozenberg G (eds) (1999) Handbook of graph grammars and computing by graph transformation 2: applications, languages, and tools. World Scientific

  8. Ferrucci F, Pacini G, Satta G et al (1994) Symbol-relation grammars: a formalism for graphical languages. Inf Comput 131(1):1–46

    Article  MathSciNet  Google Scholar 

  9. Fürst L, Mernik M, Mahnič V (2011) Improving the graph grammar parser of Rekers and Schürr. IET Softw 5(2):246–261

    Article  Google Scholar 

  10. Kong J, Zhang K, Zeng X (2006) Spatial graph grammars for graphical user interfaces. ACM Trans Comput-Human Interact 13(2):268–307

  11. Kong J, Zhang K, Dong J, Xu D (2009) Specifying behavioral semantics of UML diagrams through graph transformations. J Syst Softw 82(2):292–306

    Article  Google Scholar 

  12. Kong J, Barkol O, Bergman R, Pnueli A, Schein S, Zhang K, Zhao C (2012) Web Interface interpretation using graph grammars. IEEE Trans Syst Man Cybern 42(4):590–602

    Article  Google Scholar 

  13. Liu Y, Zeng X, Zou Y, Zhang K (2018) A graph grammar-based approach for graph layout. Software: Practice and Experience 49(8):1523–1535

    Google Scholar 

  14. Liu Y, Shi Z, Wang Y, Zou Y, Kong J, Zhang K, Zeng X (2018) An edge-based graph grammar formalism and its support system. International DMS conference on visualization and visual languages 101–108

  15. Marriott K (1994) Constraint multiset grammars. IEEE Symposium on Visual Languages, St. Louis, Missouri, 118–125

  16. Nagl M (1987) Set theoretic approaches to graph grammars. International Workshop on Graph Grammars and Their Application to Computer Science, Lecture Notes in Computer Science 291:41–54

    Article  MathSciNet  Google Scholar 

  17. Pfaltz JL, Rosefeld A (1969) Web grammars. International joint conference on artificial intelligence, 609–619

  18. Rekers J, Schürr A (1997) Defining and parsing visual languages with layered graph grammars. J Vis Lang Comput 8(1):27–55

    Article  Google Scholar 

  19. Roudaki A, Kong J, Zhang K (2016) Specification and discovery of web patterns: a graph grammar approach. Inf Sci 328:528–545

    Article  Google Scholar 

  20. Rozenberg G (Ed.) (1997) Handbook on graph grammars and computing by graph transformation 1: foundations. World Scientific

  21. Shi Z, Zeng X, Zou Y, Huang S, Li H, Hu B, Yao Y (2018) A temporal graph grammar formalism. J Vis Lang Comput 47:62–76

    Article  Google Scholar 

  22. Zeng X, Zhang K, Kong J, Song G (2005) RGG+: an enhancement to the reserved graph grammar formalism. Proc. IEEE symposium on visual languages and human-centric computing: 272–274

  23. Zhang D, Zhang K, Cao J (2001) A context-sensitive graph grammar formalism for the specification of visual languages. Comput J 44(3):187–200

    Article  Google Scholar 

  24. Zhang K, Kong J, Qiu M, Song G (2005) Multimedia layout adaptation through grammatical specifications. Multimedia Systems 10(3):245–260

    Article  Google Scholar 

  25. Zhao C, Kong J, Zhang K (2010) Program behavior discovery and verification: a graph grammar approach. IEEE Trans Softw Eng 36(3):431–448

    Article  Google Scholar 

  26. Zou Y, Zeng X, Han X (2008) Context-attributed graph grammar framework for specifying visual languages. J Southeast Univ 24(4):455–461

  27. Zou Y, Zeng X, Liu Y, Liu H (2017) Partial precedence of context-sensitive graph grammars. International symposium on visual information communication and interaction: 16–23

  28. Zou Y, Lü J, Tao X (2019) Research on context of implicit context- sensitive graph grammars. J Comput Lang 51:241–260

    Article  Google Scholar 

  29. Zou Y, Zeng X, Liu Y, Liu H (2019) Context computation for context-sensitive graph grammars: algorithms and complexities. J Vis Lang Comput 1:15–28

    Article  Google Scholar 

Download references

Acknowledgments

This work is supported in part by the National Science Foundation of China under grant 61170089.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yang Zou.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zou, Y., Zeng, X. & Zhu, Y. A general parsing algorithm with context matching for context-sensitive graph grammars. Multimed Tools Appl 81, 273–297 (2022). https://doi.org/10.1007/s11042-021-11076-8

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11042-021-11076-8

Keywords

Navigation