Sha256: be9787320f9df994d95adba666063567aa069f8b32b3d27daf422cc127f3c75e

Contents?: true

Size: 919 Bytes

Versions: 5

Compression:

Stored size: 919 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

5 entries across 5 versions & 1 rubygems

Version Path
antelope-0.3.2 lib/antelope/generator/templates/c_header.ant
antelope-0.3.0 lib/antelope/generator/templates/c_header.ant
antelope-0.2.4 lib/antelope/generator/templates/c_header.ant
antelope-0.2.3 lib/antelope/generator/templates/c_header.ant
antelope-0.2.2 lib/antelope/generator/templates/c_header.ant