Combine Grammar and Generator into top-level Imbecile class

This commit is contained in:
josh committed 2021-08-22 21:04:46 -04:00
1 parent 9273bfccf6
commit 00016f16b3
20 files changed
+96 -133

No files matched your search

+4 -4
View File
@@ -1,12 +1,12 @@
<% if @grammar.modulename %>
module <%= @grammar.modulename %>;
<% if @modulename %>
module <%= @modulename %>;
<% end %>
class <%= classname %>
{
enum
{
<% @grammar.tokens.each_with_index do |token, index| %>
<% @tokens.each_with_index do |token, index| %>
<% if token.name %>
TOKEN_<%= token.c_name %> = <%= index %>,
<% end %>
@@ -18,7 +18,7 @@ class <%= classname %>
}
static immutable string TokenNames[] = [
<% @grammar.tokens.each_with_index do |token, index| %>
<% @tokens.each_with_index do |token, index| %>
<% if token.name %>
"<%= token.name %>",
<% else %>