PREPROCESSING EMBEDDED ACTIONS.

Research output: Contribution to journalArticle

Abstract

Some parser generators allow the user to attach actions, consisting of executable code, to syntax rules. Actions are usually in the local programming language, so they are simply copied into the generated parser. However, two situations are shown in which it is convenient to allow actions to be in a different notation. A preprocessor is used to translate such notations into the local programming language. A preprocessor must know where to find actions and how to translate them. It is shown how these two activities can be programmed separately. Often, the user only has to worry about the second part: once the parser generator is known, the placement of the actions is known as well, so routines for finding actions can be separately compiled and linked in. Examples in the paper are based on the parser generator Yacc, but the approach is not limited to Yacc, or even to parser generators. Certain compositions of syntax-directed translations can be implemented by preprocessing actions.

Original languageEnglish (US)
Pages (from-to)291-297
Number of pages7
JournalSoftware - Practice and Experience
Volume14
Issue number3
StatePublished - Mar 1984
Externally publishedYes

Fingerprint

Computer programming languages
Program processors
Chemical analysis

ASJC Scopus subject areas

  • Computer Graphics and Computer-Aided Design
  • Software

Cite this

PREPROCESSING EMBEDDED ACTIONS. / Sethi, Ravi.

In: Software - Practice and Experience, Vol. 14, No. 3, 03.1984, p. 291-297.

Research output: Contribution to journalArticle

@article{0b3eb66bdcc843b4b01af2daf6ec0bd3,
title = "PREPROCESSING EMBEDDED ACTIONS.",
abstract = "Some parser generators allow the user to attach actions, consisting of executable code, to syntax rules. Actions are usually in the local programming language, so they are simply copied into the generated parser. However, two situations are shown in which it is convenient to allow actions to be in a different notation. A preprocessor is used to translate such notations into the local programming language. A preprocessor must know where to find actions and how to translate them. It is shown how these two activities can be programmed separately. Often, the user only has to worry about the second part: once the parser generator is known, the placement of the actions is known as well, so routines for finding actions can be separately compiled and linked in. Examples in the paper are based on the parser generator Yacc, but the approach is not limited to Yacc, or even to parser generators. Certain compositions of syntax-directed translations can be implemented by preprocessing actions.",
author = "Ravi Sethi",
year = "1984",
month = "3",
language = "English (US)",
volume = "14",
pages = "291--297",
journal = "Software - Practice and Experience",
issn = "0038-0644",
publisher = "John Wiley and Sons Ltd",
number = "3",

}

TY - JOUR

T1 - PREPROCESSING EMBEDDED ACTIONS.

AU - Sethi, Ravi

PY - 1984/3

Y1 - 1984/3

N2 - Some parser generators allow the user to attach actions, consisting of executable code, to syntax rules. Actions are usually in the local programming language, so they are simply copied into the generated parser. However, two situations are shown in which it is convenient to allow actions to be in a different notation. A preprocessor is used to translate such notations into the local programming language. A preprocessor must know where to find actions and how to translate them. It is shown how these two activities can be programmed separately. Often, the user only has to worry about the second part: once the parser generator is known, the placement of the actions is known as well, so routines for finding actions can be separately compiled and linked in. Examples in the paper are based on the parser generator Yacc, but the approach is not limited to Yacc, or even to parser generators. Certain compositions of syntax-directed translations can be implemented by preprocessing actions.

AB - Some parser generators allow the user to attach actions, consisting of executable code, to syntax rules. Actions are usually in the local programming language, so they are simply copied into the generated parser. However, two situations are shown in which it is convenient to allow actions to be in a different notation. A preprocessor is used to translate such notations into the local programming language. A preprocessor must know where to find actions and how to translate them. It is shown how these two activities can be programmed separately. Often, the user only has to worry about the second part: once the parser generator is known, the placement of the actions is known as well, so routines for finding actions can be separately compiled and linked in. Examples in the paper are based on the parser generator Yacc, but the approach is not limited to Yacc, or even to parser generators. Certain compositions of syntax-directed translations can be implemented by preprocessing actions.

UR - http://www.scopus.com/inward/record.url?scp=0021389373&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=0021389373&partnerID=8YFLogxK

M3 - Article

AN - SCOPUS:0021389373

VL - 14

SP - 291

EP - 297

JO - Software - Practice and Experience

JF - Software - Practice and Experience

SN - 0038-0644

IS - 3

ER -