:version
:schemaLocation?
:clip?
-=> (visualization_extension | location)*
- (userSource | delimitedFileSource | embeddedSource)+
+=> (visualization_extension | location)*[extensions]
+ (userSource | delimitedFileSource | embeddedSource)+[sources]
(sourceVariable | derivedVariable | expressionVariable
- | intervalDomain | categoricalDomain)+
- (graph | labelFrame | container | legend)+
- (style | layerController | styleCycle)+
+ | intervalDomain | categoricalDomain)+[variables]
+ (graph | labelFrame | container | legend)+[graphs]
+ (style | layerController | styleCycle)+[styles]
popup*
resources?
facetSortController?
def expect(type):
if token[0] != type:
- fatal("syntax error expecting %s" % type)
+ fatal("syntax error at %s expecting %s" % (token[0], type))
def match(type):
if token[0] in ['*', '+', '?']:
item = {'type': token[0], 'item': item}
get_token()
+ if match('['):
+ expect('id')
+ item['seq_name'] = token[1]
+ get_token()
+ must_match(']')
return item
elif (term['type'] in ('*', '+')
and term['item']['type'] == 'nonterminal'):
pass
- else:
+ elif 'seq_name' not in term:
n += 1
term['seq_name'] = 'seq' if n == 1 else 'seq%d' % n
prefix, nt_name, member_name,
member_name))
else:
- n += 1
- seq_name = 'seq' if n == 1 else 'seq%d' % n
+ seq_name = term['seq_name']
print('''\
for (size_t i = 0; i < p->n_%s; i++)
p->%s[i]->class_->spvxml_node_free (p->%s[i]);
% (member_name,
prefix, function, nt_name, member_name))
else:
- n += 1
- seq_name = 'seq' if n == 1 else 'seq%d' % n
+ seq_name = term['seq_name']
print('''\
for (size_t i = 0; i < p->n_%s; i++)
p->%s[i]->class_->spvxml_node_%s (ctx, p->%s[i]);'''