Sha256: ebf73ea177b8065ee73edd66d5de8a48a0bf9a811cba3facc33f8a2f5a1eaa46

Contents?: true

Size: 883 Bytes

Versions: 6

Compression:

Stored size: 883 Bytes

Contents

#ifndef _%{guard_name}_H
#define _%{guard_name}_H

% if define_stype?
typedef union {
  %{union_body}
} %{stype};
% end

enum %{prefix}tokentype {
% starting = 257
  %{token_prefix}EOF = 0,
% grammar.terminals.each_with_index do |terminal, i|
  %{token_prefix}%{terminal.name} = %{starting + i},
% end
};

typedef struct {
  struct %{prefix}stack_element* elements;
  unsigned int current;
  unsigned int max;
  unsigned char free;
} %{prefix}pstate;

#define %{upper_prefix}PUSH_MORE -1
#define %{upper_prefix}TERMINALS %{grammar.terminals.size}
#define %{upper_prefix}STATES %{table.size}

const char* %{prefix}token_string(%{terminal_type} token);
int %{prefix}lex(%{stype}* lval%{lex_params});
int %{prefix}parse_push(%{parse_params});
int %{prefix}parse_pull(%{parse_params});
%{prefix}pstate* %{prefix}pstate_new();
void %{prefix}pstate_delete(%{prefix}pstate* stack);

#endif

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
antelope-0.4.1 lib/antelope/generator/templates/c_header.ant
antelope-0.4.0 lib/antelope/generator/templates/c_header.ant
antelope-0.2.0 lib/antelope/generator/templates/c_header.ant
antelope-0.1.11 lib/antelope/generator/templates/c_header.ant
antelope-0.1.10 lib/antelope/generator/templates/c_header.ant
antelope-0.1.9 lib/antelope/generator/templates/c_header.ant