var dfa = nfa.to_dfa
if dfa.tags.has_key(dfa.start) then
- print "ERROR: Empty tokens {dfa.tags[dfa.start].join(" ")}"
+ print "Error: Empty tokens {dfa.tags[dfa.start].join(" ")}"
+ exit(1)
end
dfa.solve_token_inclusion
for s, tks in dfa.tags do
if tks.length <= 1 then continue
- print "ERROR: Conflicting tokens: {tks.join(" ")}"
+ print "Error: Conflicting tokens: {tks.join(" ")}"
+ exit(1)
end
print "DFA automaton: {dfa.states.length} states (see {name}.dfa.dot)"
dfa.to_dot("{name}.dfa.dot")
var id = children.first.as(Nid)
var name = id.text
if not v.v1.names.has_key(name) then
- print "Error: unknown name {name}"
+ print "{id.position} Error: unknown name {name}"
exit(1)
abort
end
var node = v.v1.names[name]
if node isa Nprod then
- print "Error: cannot use production {name} in a regular expression"
+ print "{id.position} Error: cannot use production {name} in a regular expression"
exit(1)
abort
else if not node isa Nexpr then
var id = children[1].as(Nid)
var name = id.text
if not v.v1.names.has_key(name) then
- print "Error: unknown name {name}"
+ print "{id.position} Error: unknown name {name}"
exit(1)
abort
end
var node = v.v1.names[name]
var elem: nullable Element
if node isa Nprod then
- print "Error cannot ignore a production"
+ print "{id.position} Error: cannot ignore a production"
exit(1)
abort
else if node isa Nexpr then
var id = children.first.as(Nid)
var name = id.text
if not v.v1.names.has_key(name) then
- print "Error: unknown name {name}"
+ print "{id.position} Error: unknown name {name}"
exit(1)
abort
end