LLOOP Index | GSP Language | GSP Library | Framework Classes | Component Classes

LLOOP Standard Symbols, Tokens and Pre-processors

LLOOP provides a library of standard gsp specifications which gather the following useful symbols, tokens and pre-processors:


Standard symbols System symbols Special symbols Wild symbols C-language symbols ISO symbols Pre-processors
bool
char
double
id
int
nil
quote
quoteorstring
string
text
word
file
fileunix
filewindows
image
urlfile
ctrl
any
byte
block
line
double
int
quote
comment_c
comment_cpp
ISO_639
backslashnewline
c_comment
cplusplus_comment
dos_comment
define
ini_comment
shell_comment

bool

This defines the following boolean types:

- 2-states boolean: reads 'yes' or 'no'

- 3-states boolean (phi-boolean): 'yes', 'no', 'unknown'

source

char

Reads a char. Preceding whitespaces are eaten as usual.

source

double

Reads a "double" C type (including overflow check).

source

id

Reads a sequence of alphanumeric letters, underscores, colons, dots.

source

int

Reads a "long" C type (including overflow check).

source

nil

NO-OP symbol. Does nothing.

source

quote

Reads any sequence of chars enclosed by double or simple quote chars. Escape chars are supported.

source

quoteorstring

Reads either a quote token or a string token.

source

string

Reads any sequence of printable chars (between 0x20 (' ') and 0x7E ('~')), except space chars.

source

text

Reads any sequence of printable chars (between 0x20 (' ') and 0x7E ('~')).

source

word

Reads a sequence of letters, underscores and numeric chars starting with a letter. This token is implemented using the standard String class. The chars read from the input are appended to the final string using the appropriate methods of the inherited String class.

source

file

This defines several tokens related to files:

- file: reads a file name or path, either UNIX or Windows

- existingfile: same as file, except that the file must exist

- directory: same as file, except that the file must be a valid directory if it exists

- existingdir: same as directory, except the directory must exist and must be a directory

- forcedir: same as directory, except the directory is created if it does not exist. An error is raised if it already exists and it is not a directory.

source

fileunix

Reads a unix file/directory name or path.

Names are separated with slash chars '/'.

Any ASCII char can be used for the names, but the first encountered white space char marks the end of the path.

Whitespaces inside file paths must be banalized using backslash chars '\', or alternatively the full path can be enclosed by quotes. Escape chars are allowed.

source

filewindows

Reads a windows file/directory name or path. This is quite different from reading a unix path.

Names are separated with backslash chars '\' and no escape sequence is allowed.

Any printable char (0x20 to 0x7E in ASCII) except '/', ',', ':', '*', '?', '"', '<', '>' and '|' can be used for the names, but the first encountered white space char marks the end of the path. File names containing white space chars must be enclosed by double quotes.

source

image

Reads the name or the path of an existing image.

It also checks whether the file has a valid image file extension, ie. png, jpg, jpeg, gif, ppm, bmp, xpm, xbm, pbm, pcx, pgm, eps.

Raises an error when the file does not exist or when the image extension is not recognised.

source

urlfile

Reads an URL file, ie. a Universal Resource Locator starting with file://. Platform-specific paths are accepted following the URL prefix.

Example:

 file://readme.txt
 file:///home/myaccount/myfile.txt

source

ctrl

Control symbols. Control symbols do not parse anything but rather act like parse control functions. There are intended to add some control over parent symbols, like whitespace enabling.

source

any

Reads any multi-line sequence of chars with an end delimiter (any constant string).

The Any token is a specialization of the BlockToken, whereby the left delimiter is forced to an empty string value.

source

byte

Any byte, inclusive those standing for whitespace chars.

source

block

Reads any multi-line sequence of chars surrounded by start and end delimiters (i.e. any constant string).

source

line

All chars until next new line.

source

double

Reads a "double" C type (including overflow check).

source

int

Reads a "long" C type (including overflow check).

source

quote

Reads any sequence of chars enclosed by double or simple quote chars. Escape chars are supported.

source

comment_c

Reads a C comment.

source

comment_cpp

Reads a C++ comment, ie. either a pure C comment or a one-line C++ comment.

source

ISO_639

This defines two symbols:

- ISO639_2LetterCode: ISO 639 Country 2-Letter Codes

- ISO639_3LetterCode: ISO 639 Country 3-Letter Codes

source

backslashnewline

Concatenates lines separated with a banalized new line, regardless of used platform line separator (\n, \n\r...).

source

c_comment

Pre-processes C comments. Strips the input of any C comment, but regardless of whether the comment is within quotes.

source

cplusplus_comment

Pre-processes C++ comments (//) Strips the input of any C++ // comment, but regardless of whether the comment is within quotes.

source

dos_comment

Pre-processes MS-DOS comments (') Strips the input data of all ' comments regardless of whether the comment is within quotes. The REM notation is not supported.

source

define

Pre-processes C #define. Fulfils the same function as a C #define statement.

The static member function "add" allows to add a new define, given the define name and the replacement string

Example:

 #define NAME "James" => define::add("NAME", "\"James\"");

source

ini_comment

Pre-processes Windows Ini File comments.

Strips the input of all ini comments, i.e. all chars following ; till end of line.

source

shell_comment

Pre-processes shell script comments.

Strips the input of all shell comments, i.e. all chars following # till end of line.

source


This file is part of the LLOOP Reversible Object-Oriented Parser Generator. Copyright (c) 2005-2006 Michel MEHL, France. All rights reserved. LLOOP is distributed by the company ERSA SaRL.


Copyright (c) 2005-2006 Michel MEHL, Haguenau, France
LLOOP version 1.1