summaryrefslogtreecommitdiff
path: root/vtparse/src/vtparse_check_tables.rb
diff options
context:
space:
mode:
Diffstat (limited to 'vtparse/src/vtparse_check_tables.rb')
-rw-r--r--vtparse/src/vtparse_check_tables.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/vtparse/src/vtparse_check_tables.rb b/vtparse/src/vtparse_check_tables.rb
new file mode 100644
index 0000000..2bfa122
--- /dev/null
+++ b/vtparse/src/vtparse_check_tables.rb
@@ -0,0 +1,24 @@
+
+require 'vtparse_tables'
+
+#
+# check that for every state, there is a transition defined
+# for every character between 0 and A0.
+#
+
+table = {}
+
+anywhere_array = expand_ranges($states[:ANYWHERE])
+
+$state_tables.each { |state, table|
+ next if state == :ANYWHERE
+
+ table.each_with_index { |val, i|
+ if not (val or $state_tables[:ANYWHERE][i])
+ raise "No transition defined from state #{state}, char 0x#{i.to_s(16)}!"
+ end
+ }
+}
+
+puts "Tables had all necessary transitions defined."
+