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.
Similar content being viewed by others
References
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
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
Costagliola G, Deufemia V, Polese G, Risi M (2005) Building syntax-aware editors for visual languages. J Vis Lang Comput 16(6):508–540
Costagliola G, Deufemia V, Polese G (2007) Visual language implementation through standard compiler-compiler techniques. J Vis Lang Comput 18(2):165–226
Costagliola G, Rosa M, Minas M (2019) Visual parsing and parser visualization. IEEE symposium on visual languages and human-centric computing 243–247
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
Engels G, Kreowski HJ, Rozenberg G (eds) (1999) Handbook of graph grammars and computing by graph transformation 2: applications, languages, and tools. World Scientific
Ferrucci F, Pacini G, Satta G et al (1994) Symbol-relation grammars: a formalism for graphical languages. Inf Comput 131(1):1–46
Fürst L, Mernik M, Mahnič V (2011) Improving the graph grammar parser of Rekers and Schürr. IET Softw 5(2):246–261
Kong J, Zhang K, Zeng X (2006) Spatial graph grammars for graphical user interfaces. ACM Trans Comput-Human Interact 13(2):268–307
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
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
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
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
Marriott K (1994) Constraint multiset grammars. IEEE Symposium on Visual Languages, St. Louis, Missouri, 118–125
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
Pfaltz JL, Rosefeld A (1969) Web grammars. International joint conference on artificial intelligence, 609–619
Rekers J, Schürr A (1997) Defining and parsing visual languages with layered graph grammars. J Vis Lang Comput 8(1):27–55
Roudaki A, Kong J, Zhang K (2016) Specification and discovery of web patterns: a graph grammar approach. Inf Sci 328:528–545
Rozenberg G (Ed.) (1997) Handbook on graph grammars and computing by graph transformation 1: foundations. World Scientific
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
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
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
Zhang K, Kong J, Qiu M, Song G (2005) Multimedia layout adaptation through grammatical specifications. Multimedia Systems 10(3):245–260
Zhao C, Kong J, Zhang K (2010) Program behavior discovery and verification: a graph grammar approach. IEEE Trans Softw Eng 36(3):431–448
Zou Y, Zeng X, Han X (2008) Context-attributed graph grammar framework for specifying visual languages. J Southeast Univ 24(4):455–461
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
Zou Y, Lü J, Tao X (2019) Research on context of implicit context- sensitive graph grammars. J Comput Lang 51:241–260
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
Acknowledgments
This work is supported in part by the National Science Foundation of China under grant 61170089.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
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
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11042-021-11076-8