Next: Operators
Up: Syntax
Previous: Formal definition of clause
  Index
Subsections
Syntax Differences between ECLiPSe and other Prologs
Some particularities exist in the default syntax of ECLiPSe.
Most of these properties can be configured and are in fact changed
by the compatibility packages.
- Syntax for the special types of ECLiPSe: metaterms and rationals.
- A blank space is allowed between the functor and the following opening
parenthesis (see below)
- end of file is accepted as fullstop
- operators with precedence higher than 1000 are allowed
in a comma-separated list of terms, i.e. structure arguments
and lists (see below).
The ambiguity is resolved by considering commas
as argument separators rather than operators inside the term.
Thus e.g.
p(a :- b, c)
is accepted and parsed as p/2.
- double-quoted items are parsed as strings, not as lists
(controlled via set_chtab/2)
- empty brackets are not parsed as the atom '[]' when there are
layout charactes between the brackets (controlled by syntax option
blanks_in_nil)
- newline is not allowed inside quotes (controlled by syntax option
nl_in_quotes)
Changing the Parser behaviour
Some of these properties can be changed by selecting one of the
following syntax options using set_flag/2.
The following options exist:
- blanks_in_nil
- allow blanks between the brackets in [].
- limit_arg_precedence
- do not allow terms with a precedence higher than 999 as
structure arguments, unless parenthesised.
- nested_comments
- allow bracketed comments to be nested.
- nl_in_quotes
- allow newlines to occur inside quotes.
- no_blanks
- do not allow blanks between functor an opening parenthesis
- no_other_quotes
- do not allow string quotes inside atom quotes and vice versa.
- $VAR
- terms of the form '$VAR'(N) are printed in a special way by all the
predicates that obey operator declarations (i.e. write, writeq, print
and partly printf). '$VAR'(0) is printed as A, '$VAR'(25) as Z,
'$VAR'(26) as A1 and so on.
When the argument is an atom or a string, just this argument is printed.
- based_bignums
- Allow base notation even to write integers longer than the wordsize
(i.e. they are always positive).
Syntax option settings are local to the module where they were performed.
They are switched on and off as follows:
:- set_flag(syntax_option, nl_in_quotes).
:- set_flag(syntax_option, not no_blanks).
Next: Operators
Up: Syntax
Previous: Formal definition of clause
  Index
1999-08-06