This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
Parsing Languages by Pattern Matching
April 1988 (vol. 14 no. 4)
pp. 498-511

The language of universal algebras is used as an alternative approach for programming language specification. BNF rules are employed for specifying the signature of the language algebra instead of the context free syntax. The algorithm for program parsing is inductively defined by the following universal algebraic construction: Any function defined on the generators of a free algebra taking values in the carrier of another similar algebra can he uniquely extended to a homomorphism between the two algebras. Any conventional programming language can be specified by a finite set of BNF rules and its algebra of symbols is generated by a finite set of generator classes. Thus any function defined on the finite set of generators offers an algebraic mechanism for a universal algorithm for source language program parsing. The right-hand side of the BNF rules are the patterns searched by the algorithm in the source text of the program. The essential feature of this algorithm is that it can be used as a driver for code generation and optimization in a translator. This driver recognizes source language constructs in the source text. The code generator evaluates them into the target language regenerating the source language program inductively as a target language program. Therefore this parser is also called a program evaluator.

[1] T. P. Backer, "A one pass algorithm for overload resolution in Ada,"ACM Trans. Program. Lang., Syst., vol. 4, no. 4, pp. 601-614, 1982.
[2] E. W. Dijkstra, "An Algol-60 translator for Xl,"Annu. Rev. Automat. Program., vol. 3, pp. 329-345, 1963.
[3] J. A. Goguen, J. W. Thatcher, E. Wagner, and J. B. Wright, "Initial algebra semantics and continuous algebras,"J. ACM, vol. 24, no. 1, pp. 68-95, 1977.
[4] M. Gordon,The Denotational Description of Programming Languages. New York: Springer-Verlag, 1979.
[5] W. S. Hatcher and T. Rus, "Context free algebras,"J. Cybern., no. 6, pp. 65-77, 1976.
[6] R. R. Henry, "Code generation tutorial," inACM SIGPLAN'86 Compiler Construction Tutorial Notes, Palo Alto, CA, June 23-27, 1986.
[7] P. J. Higgins, "Algebras with a scheme of operators,"Math. Nachrichten, vol. 27, pp. 115-132, 1963-1964.
[8] C. M. Hoffmann and M. J. O'Donnell, "Pattern matching in trees,"J. ACM, vol. 29, no. 1, pp. 68-95, Jan. 1982.
[9] J. D. Ichbiahet al., "Rationale for the design of the Ada programming language,"SIGPLAN Notices, vol. 14, (Tech. Rep. 6), pt. B, June 1979.
[10] J. B. Johnston, "Contour model of block structured processes,"SIGPLAN Notices, vol. 62, pp. 58-82, 1971.
[11] C. B. Jones and P. Lucas, "Proving correctness of implementation techniques," in Engeler. E. (Ed.),Symp. Semantics of AlgorithmicLanguages, (Lecture Notes in Mathematics, vol. 188). E. Engeler, Ed., 1971, pp. 178-211.
[12] D. E. Knuth, J. M. Morris Jr., and V. R. Pratt, "Fast pattern matching in strings,"SIAM J. Comput., vol. 6, no. 2, pp. 323-350. June 1977.
[13] A. G. Kurosh,Lectures in General Algebras. New York: Pergamon, 1965.
[14] J. LePeau, "Noncanonical bounded-context parsers," M.S. thesis, Dep. Comput. Sci., Univ. Iowa, Iowa City.
[15] T. Pennello, F. L. DeRemer, and R. Meyers, "A simplified operator identification scheme for Ada,"ACM SlGPLAN Notices, vol. 15, no. 7, 8, pp. 82-87, 1980.
[16] T. Rus,Data Structures and Operating Systems. New York: Wiley, 1979.
[17] T. Rus, "HAS-hierarchy: A natural tool for language specification,"Fundamenta Inform., vol. III, no. 3, pp. 269-294, 1980.
[18] T. Rus, "An alternative to CF grammar for language specification," inProc. IEEE ICCL, Miami Beach. FL, Oct. 27-30, 1986, pp. 144- 155.
[19] T. G. Szymanski and J. H. Williams, "Noncanonical extensions of bottom-up parsing techniques,"SIAM J. Comput., vol. 5, pp. 231- 250, 1976.
[20] W. M. Waite andG. Goos, Compiler Construction. New York: Springer-Verlag, 1984.
[21] D. A. Watt, "Contextual constraints," inMethods and Tools for Compiler Construction, B. Lohro, Ed. London: Cambridge University Press, 1984.
[22] J. B. Williams, "Bounded context parsable grammars,"Inform. Contr., vol. 28, pp. 314-334, 1975.

Index Terms:
Algebraic model, algorithm, BNF-rule, compiler,complexity, language, pattern matching, program evaluation, programming language, program parsing, specification mechanism.
Citation:
T. Rus, "Parsing Languages by Pattern Matching," IEEE Transactions on Software Engineering, vol. 14, no. 4, pp. 498-511, April 1988, doi:10.1109/32.4672
Usage of this product signifies your acceptance of the Terms of Use.