[SCL] SCL syntax

Pat Hayes phayes at ihmc.us
Fri Feb 20 15:42:28 CST 2004


Mark, (and indeed anyone else :-)  if you could cast an eye over the 
new draft of the syntax I would be grateful.

http://www.ihmc.us/users/phayes/SCL_current_2004_rf.html


It tries to stick with approach 4.
I have completely rewritten the lexical stuff. The intention now is 
that the first symbol of a lexical item signals its type:
( or ) force a lexeme break and are always themselves;
= can only be itself if its the first character,  but does not force a break;
@ can only start a seqvar, which cannot contain @;
' can only start a quoted string, and (unless preceded by \) must end it;
whitespace starts a whitespace sequence which forces a lexeme break
control characters are errors.
Numerals are sequences of digits.

Other than this, any character can occur inside a name, so for 
example these are all legal names:
=
ab2
2ab
abc
a=b
ab=
a'b
http://www.chowbaby.com/restaurantnameMsa.asp?restid=15622306
~!@#$%^*:"{}|+_4567#$%^&,&.**shflsdhjf;asdjkf;jk|;

but not these:

=ab    (starts with = and is not just =)
@a at bc    (illegal seqvar)
'ab    (starts with ' but isnt unquoted)
~!@#$%^*:"{}|+_4567(#$%^&,&.**shflsdhjf;asdjkf;jk|;      (has '(' in it)

This is motivated partly by wanting to allow URIs to be names, by the 
way.  (Right now URIs officially even may contain whitespace, but 
this will soon be changed, I gather. In practice browsers don't work 
with whitespace so nobody uses this anyway.)

The expression syntax allows strings and numerals to count as names 
(and this is made explicit). We could change this, but only at the 
cost of making the expression syntax more complicated.  I'm inclined 
to just let it happen, since the semantics could handle it, so it is 
legal to write things like
('abc' 17)
which can be satisfied if the character string 'abc' can be mapped 
(folded) into some relational extension with <17> in it. Well, if 
that's what you write, that's what you get :-) And seriously, the 
things that people finish up wanting to do when they write things 
like Web scrapers can actually produce text like this, eg you might 
want to treat a piece of NL text as meaning a category of things, ie 
a unary predicate.


Pat

-- 
---------------------------------------------------------------------
IHMC	(850)434 8903 or (650)494 3973   home
40 South Alcaniz St.	(850)202 4416   office
Pensacola			(850)202 4440   fax
FL 32501			(850)291 0667    cell
phayes at ihmc.us       http://www.ihmc.us/users/phayes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://philebus.tamu.edu/pipermail/scl/attachments/20040220/45ee7b84/attachment.html


More information about the SCL mailing list