From f1d236b83003eda71e12840732d159fd23b1b771 Mon Sep 17 00:00:00 2001 From: xleroy Date: Tue, 29 Apr 2014 13:58:18 +0000 Subject: Integration of Jacques-Henri Jourdan's verified parser. (Merge of branch newparser.) git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2469 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- cparser/Parser.vy | 845 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 845 insertions(+) create mode 100644 cparser/Parser.vy (limited to 'cparser/Parser.vy') diff --git a/cparser/Parser.vy b/cparser/Parser.vy new file mode 100644 index 00000000..b5d4dd60 --- /dev/null +++ b/cparser/Parser.vy @@ -0,0 +1,845 @@ +/* *********************************************************************/ +/* */ +/* The Compcert verified compiler */ +/* */ +/* Jacques-Henri Jourdan, INRIA Paris-Rocquencourt */ +/* */ +/* Copyright Institut National de Recherche en Informatique et en */ +/* Automatique. All rights reserved. This file is distributed */ +/* under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, either version 2 of the License, or */ +/* (at your option) any later version. This file is also distributed */ +/* under the terms of the INRIA Non-Commercial License Agreement. */ +/* */ +/* *********************************************************************/ + +%{ + +Require Import Cabs. +Require Import List. + +%} + +%token VAR_NAME TYPEDEF_NAME OTHER_NAME +%token PRAGMA +%token CONSTANT +%token SIZEOF PTR INC DEC LEFT RIGHT LEQ GEQ EQEQ EQ NEQ LT GT + ANDAND BARBAR PLUS MINUS STAR TILDE BANG SLASH PERCENT HAT BAR QUESTION + COLON AND ALIGNOF + +%token MUL_ASSIGN DIV_ASSIGN MOD_ASSIGN ADD_ASSIGN SUB_ASSIGN + LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN + +%token LPAREN RPAREN LBRACK RBRACK LBRACE RBRACE DOT COMMA + SEMICOLON ELLIPSIS TYPEDEF EXTERN STATIC RESTRICT AUTO REGISTER INLINE + CHAR SHORT INT LONG SIGNED UNSIGNED FLOAT DOUBLE CONST VOLATILE VOID + STRUCT UNION ENUM UNDERSCORE_BOOL PACKED ALIGNAS ATTRIBUTE ASM + +%token CASE DEFAULT IF ELSE SWITCH WHILE DO FOR GOTO CONTINUE BREAK + RETURN BUILTIN_VA_ARG + +%token EOF + +%type primary_expression postfix_expression + unary_expression cast_expression multiplicative_expression additive_expression + shift_expression relational_expression equality_expression AND_expression + exclusive_OR_expression inclusive_OR_expression logical_AND_expression + logical_OR_expression conditional_expression assignment_expression + constant_expression expression +%type unary_operator +%type assignment_operator +%type argument_expression_list +%type declaration +%type declaration_specifiers +%type init_declarator_list +%type init_declarator +%type storage_class_specifier +%type type_specifier struct_or_union_specifier enum_specifier +%type struct_or_union +%type struct_declaration_list +%type struct_declaration +%type specifier_qualifier_list +%type struct_declarator_list +%type