WHITESPACE(2)

Table of Contents

Name

whitespace specifies the specification white space token

Synopsis

%whitespace lex-token

Description

The whitespace section of a source description file defines the white space token for an SDTool's specification file. These are the characters that serve to separate the grammar tokens in a specification file, but don't contribute to the meaning of the specification.

The lex-token is specified as a lex token; it is copied directly into the generated lex.l file.

There is a default white space token provided by ivy*meta SDTB. It includes newlines, spaces, tabs, C style comments and C preprocessor #line constructs. This is adequate for nearly all UNIX System SDTools. Here is the default white space token shown through lex definitions:

COMMENT
«/*"([^*]*|"*"+[^*/])*"*"+"/"
CTRLLINE
^#line.+\n
WHITE
[\ \n\t]|{CTRLLINE}|{COMMENT}

The white space preceding every grammar token is stored in the token parse tree nodes (see TOKEN(5) ); this allows routines (e.g., frontier) to reconstruct the original input stream.

Example

%whitespace [\ \t\n]

Note

When the #line C preprocessor directive is included in the definition of white space, the SDTool will use them in setting the values of the line number of file name fields in the token nodes (see TOKEN(5) and BEGLINE(5) ).

See Also

GRAMMAR(2)
LEX(2)
BEGLINE(5)
TOKEN(5)

Documentation

Lex - A Lexical Analyzer Generator, M.E. Lesk and E. Schmidt


© 1990 Lucent Technologies, Inc
© 1998 Harmony Software, Inc