view anagram/agcore/bpe3.h @ 21:1c9dac05d040

Add lint-style FALLTHROUGH annotations to fallthrough cases. (in the parse engine and thus the output code) Document this, because the old output causes warnings with gcc10.
author David A. Holland
date Mon, 13 Jun 2022 00:04:38 -0400
parents 13d2b8934445
children
line wrap: on
line source

/*
 * AnaGram, A System for Syntax Directed Programming
 * Copyright 1993-2002 Parsifal Software. All Rights Reserved.
 * See the file COPYING for license and usage terms.
 *
 * bpe3.h - build parse engine, rev. 3
 */

#ifndef BPE3_H
#define BPE3_H

struct string_dict; // from dict.h
struct CSegment; // from rproc.h
#include "agstack.h"


typedef enum {
  pe_shift_accept,
  pe_go_to,
  pe_shift_reduce,
  pe_shift_simple_reduce,
  pe_reduce_form,
  pe_simple_reduce,
  pe_accept,
  pe_syn_error,
  pe_null_go_to,
  pe_skip,
  pe_skip_reduce,
  pe_recover
} pe_parser_action;

extern AgStack<CSegment> extensionStack;
extern AgStack<CSegment> cSegmentStack;
extern int               nPrologueSegments;

extern string_dict *my_macros;
extern int pe_line_count;
extern char buildErrorMsg[];
extern char *my_macros_subs[];

void build_parse_table(void);
void build_parse_engine(void);

#endif /* BPE3_H */