Hi!
There is an issue with the Kappa grammar I encountered when writing an Emacs mode for Kappa. Here is what the KaSim manual says about IDs:
> Symbol Id can be any string generated by regular expression [a-zA-Z0-9][a-zA-Z0-9_-]*.
This is ambiguous when used in variable definitions as illustrated below:
# These variable definitions illustrate the ambiguity between numerals
# and IDs in the Kappa grammar.
%var: '1A' 1A # 1A is an agent name
%var: '1E' 1E # 1E is an agent name
%var: '1E+1' 1E+1 # 1E+1 is a numeral
%var: '200' 200 # 200 is a numeral (no agent signature)
%var: '100' 100 # 1E0 is both a numeral and an agent name
%var: '1E0' 1E0 # 1E0 is both a numeral and an agent name
In practice, KaSim doesn't accept agent signatures with "numeric" agent names. E.g. the following code
# Numeric IDs in agent signatures
%agent: 1A(x) # Declaration of agent 1A => works.
%agent: 1E(x) # Declaration of agent 1E => works.
%agent: 100(x) # Declaration of agent 100 => fails!
%agent: 1E0(x) # Declaration of agent 1E0 => fails!
will generate a parser error:
Error (id_bug.ka) line 19, character 11: Malformed agent
signature, I was expecting something of the form '%agent:
A(x,y~u~v,z)'
Is there any specific reason for allowing IDs with an initial digit?
Cheers
/Sandro