Allow specifying the start rule name

This commit is contained in:
josh committed 2024-05-05 12:39:00 -04:00
1 parent 508dabe760
commit 494afb7307
12 files changed
+119 -18

No files matched your search

+2 -2
View File
@@ -144,7 +144,7 @@ typedef struct
/** Parse result value. */
<% if @grammar.ast %>
<%= @grammar.ast_prefix %>Start<%= @grammar.ast_suffix %> * parse_result;
<%= @grammar.ast_prefix %><%= @grammar.start_rule %><%= @grammar.ast_suffix %> * parse_result;
<% else %>
<%= @grammar.prefix %>value_t parse_result;
<% end %>
@@ -173,7 +173,7 @@ size_t <%= @grammar.prefix %>lex(<%= @grammar.prefix %>context_t * context, <%=
size_t <%= @grammar.prefix %>parse(<%= @grammar.prefix %>context_t * context);
<% if @grammar.ast %>
<%= @grammar.ast_prefix %>Start<%= @grammar.ast_suffix %> * <%= @grammar.prefix %>result(<%= @grammar.prefix %>context_t * context);
<%= @grammar.ast_prefix %><%= @grammar.start_rule %><%= @grammar.ast_suffix %> * <%= @grammar.prefix %>result(<%= @grammar.prefix %>context_t * context);
<% else %>
<%= start_rule_type[1] %> <%= @grammar.prefix %>result(<%= @grammar.prefix %>context_t * context);
<% end %>