Up Next

1  Lexical Conventions

Blanks

The following characters are considered as blanks: space, newline and horizontal tabulation. Blanks separate adjacent identifiers, literals and keywords that would be otherwise confused as a single identifier, literal or keyword. Apart from that, they are ignored.

Comments

Comments are C-like comments. They start with the characters /* and end with the characters */. C++ comments style can also be used; all characters from the two characters // until the end of the line are considered as part of a comment. Comments are treated as blanks.

Special lexeme

There are several kinds of identifiers : They use common definitions of letter and digit.
letter   ::=   A..Z | a..z
digit   ::=   0..9


Identifiers

Identifiers are a sequence of letters, digits and _ (the underscore character) starting with a letter or an underscore. A letter can be any of the 52 lowercase and uppercase letters from the ASCII set. The current implementation places no limit on the number of characters of an identifier.
ident   ::=   (letter | _) (letter | digit | _) *


Header names

Header names are a sequence of letters, digits and - (the minus character) starting with a letter and ending with a colon. A letter can be any of the 52 lowercase and uppercase letters from the ASCII set. The current implementation places no limit on the number of characters of a header name.
headerId   ::=   #letter (letter | digit | _ | ! | % | * | - | + | ' | ` | ~) * :


Event identifiers

Event identifiers are a sequence of letters, digits and special characters as defined in RFC 3265. A letter can be any of the 52 lowercase and uppercase letters from the ASCII set. The current implementation places no limit on the number of characters of an event identifier.
eventIdent   ::=   event-package (. event-template) *
event-package   ::=   token-nodot
event-template   ::=   token-nodot
token-nodot   ::=   (letter | digit | _ | ! | % | * | - | + | ' | ` | ~) +


URI Scheme

URI scheme are defined as in RFC 3261
uriScheme   ::=   letter (letter | digit | - | + | .) *


Integer Literals

An integer literal is a sequence of one or more digits. Integer literals are in decimal (radix 10).
integer   ::=   0 | (1..9 digit *)


Prefix and Infix Operator

The following tokens are the SPL operators:
= + - * / &&
== != < > >= ||
<= ! match notmatch


Keywords

The identifiers below are reserved keywords:
BODY bool branch break bye
cancel case continue default deploy
dialog else event false FIFO
foreach forward http https if
in incoming int LIFO local
mailto match notmatch outgoing parallel
pop processing push reason registration
remote request requestURI response return
select service sip sips string
time true type undeploy uninvite
unregister unsubscribe uri void when
with


The following character sequences are also reserved.
{ } [ ] ( ) < > |
= : , ; .


Besides the above mentioned keywords, all sipHeader, responseKind and SIPmethod are also keywords and are written in uppercase.

Ambiguities

Lexical ambiguities are resolved according to the “longest match” rule: when a character sequence can be decomposed into tokens in several different ways, the resulting decomposition is the one with the longest first token.


Up Next