Changeset 8c97ee7


Ignore:
Timestamp:
Jul 5, 2017, 4:43:15 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
1ce2189
Parents:
44f44617
Message:

Fixed the pretty printer

Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r44f44617 r8c97ee7  
    4848tools/prettyprinter/parser.cc
    4949tools/prettyprinter/parser.h
     50tools/prettyprinter/parser.hh
    5051tools/prettyprinter/pretty
    5152tools/pretty
  • tools/prettyprinter/Makefile.am

    r44f44617 r8c97ee7  
    1515###############################################################################
    1616
    17 BUILT_SOURCES = parser.h
     17BUILT_SOURCES = parser.hh
    1818
    1919AM_YFLAGS = -d -t -v
  • tools/prettyprinter/Makefile.in

    r44f44617 r8c97ee7  
    323323top_builddir = @top_builddir@
    324324top_srcdir = @top_srcdir@
    325 BUILT_SOURCES = parser.h
     325BUILT_SOURCES = parser.hh
    326326AM_YFLAGS = -d -t -v
    327327SRC = lex.ll \
  • tools/prettyprinter/filter.cc

    r44f44617 r8c97ee7  
    1919using namespace std;
    2020#include "filter.h"
    21 #include "parser.h"
     21#include "parser.hh"
    2222
    2323
  • tools/prettyprinter/filter.h

    r44f44617 r8c97ee7  
    1717#define __FILTER_H__
    1818
    19 #include "parser.hh"
     19#include "ParserTypes.h"
    2020
    2121extern void (* filter)( Token * tree );                                 // pointer to filter for parse tree
  • tools/prettyprinter/lex.ll

    r44f44617 r8c97ee7  
    2323#include <iostream>
    2424using namespace std;
     25#include "ParserTypes.h"
    2526#include "parser.hh"
    26 #include "parser.h"
    2727
    2828#define RETURN_TOKEN( kind ) yylval.tokenp = new Token( yytext, ws_list, kind ); return kind;
  • tools/prettyprinter/parser.hh

    r44f44617 r8c97ee7  
    1 //                              -*- Mode: C++ -*-
    2 //
    3 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
    4 //
    5 // The contents of this file are covered under the licence agreement in the
    6 // file "LICENCE" distributed with Cforall.
    7 //
    8 // parse.h - Various declarations that are needed so that the generated parser
    9 //           and lexer compile with C++, and to share information between the
    10 //           parser, lexer, and driver program
    11 //
    12 // Author           : Richard C. Bilson and Rodolfo G. Esteves
    13 // Created On       : Sun Dec 16 15:00:49 2001
    14 // Last Modified By : Peter A. Buhr
    15 // Last Modified On : Wed Jun 28 22:59:27 2017
    16 // Update Count     : 174
    17 //
     1/* A Bison parser, made by GNU Bison 3.0.4.  */
    182
    19 #ifndef __PARSER_HH__
    20 #define __PARSER_HH__
     3/* Bison interface for Yacc-like parsers in C
    214
    22 int yylex();
     5   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
    236
    24 #include <string>
    25 #include <list>
    26 #include "token.h"
     7   This program is free software: you can redistribute it and/or modify
     8   it under the terms of the GNU General Public License as published by
     9   the Free Software Foundation, either version 3 of the License, or
     10   (at your option) any later version.
    2711
    28 #endif // __PARSER_HH__
     12   This program is distributed in the hope that it will be useful,
     13   but WITHOUT ANY WARRANTY; without even the implied warranty of
     14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15   GNU General Public License for more details.
    2916
    30 // Local Variables: //
    31 // mode: c++ //
    32 // tab-width: 4 //
    33 // compile-command: "make install" //
    34 // End: //
     17   You should have received a copy of the GNU General Public License
     18   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
     19
     20/* As a special exception, you may create a larger work that contains
     21   part or all of the Bison parser skeleton and distribute that work
     22   under terms of your choice, so long as that work isn't itself a
     23   parser generator using the skeleton or a modified version thereof
     24   as a parser skeleton.  Alternatively, if you modify or redistribute
     25   the parser skeleton itself, you may (at your option) remove this
     26   special exception, which will cause the skeleton and the resulting
     27   Bison output files to be licensed under the GNU General Public
     28   License without this special exception.
     29
     30   This special exception was added by the Free Software Foundation in
     31   version 2.2 of Bison.  */
     32
     33#ifndef YY_YY_PARSER_HH_INCLUDED
     34# define YY_YY_PARSER_HH_INCLUDED
     35/* Debug traces.  */
     36#ifndef YYDEBUG
     37# define YYDEBUG 1
     38#endif
     39#if YYDEBUG
     40extern int yydebug;
     41#endif
     42
     43/* Token type.  */
     44#ifndef YYTOKENTYPE
     45# define YYTOKENTYPE
     46  enum yytokentype
     47  {
     48    MARK = 258,
     49    LCURL = 259,
     50    RCURL = 260,
     51    INTEGER = 261,
     52    CHARACTER = 262,
     53    IDENTIFIER = 263,
     54    CODE = 264,
     55    START = 265,
     56    UNION = 266,
     57    TOKEN = 267,
     58    LEFT = 268,
     59    RIGHT = 269,
     60    NONASSOC = 270,
     61    TYPE = 271,
     62    PURE_PARSER = 272,
     63    SEMANTIC_PARSER = 273,
     64    EXPECT = 274,
     65    THONG = 275,
     66    PREC = 276,
     67    END_TERMINALS = 277,
     68    _SECTIONS = 278,
     69    _DEFSECTION_OPT = 279,
     70    _LITERALBLOCK = 280,
     71    _DECLARATION = 281,
     72    _TAG_OPT = 282,
     73    _NAMENOLIST = 283,
     74    _NAMENO = 284,
     75    _NAMELIST = 285,
     76    _RULESECTION = 286,
     77    _RULE = 287,
     78    _LHS = 288,
     79    _RHS = 289,
     80    _PREC = 290,
     81    _ACTION = 291,
     82    _USERSECTION_OPT = 292
     83  };
     84#endif
     85/* Tokens.  */
     86#define MARK 258
     87#define LCURL 259
     88#define RCURL 260
     89#define INTEGER 261
     90#define CHARACTER 262
     91#define IDENTIFIER 263
     92#define CODE 264
     93#define START 265
     94#define UNION 266
     95#define TOKEN 267
     96#define LEFT 268
     97#define RIGHT 269
     98#define NONASSOC 270
     99#define TYPE 271
     100#define PURE_PARSER 272
     101#define SEMANTIC_PARSER 273
     102#define EXPECT 274
     103#define THONG 275
     104#define PREC 276
     105#define END_TERMINALS 277
     106#define _SECTIONS 278
     107#define _DEFSECTION_OPT 279
     108#define _LITERALBLOCK 280
     109#define _DECLARATION 281
     110#define _TAG_OPT 282
     111#define _NAMENOLIST 283
     112#define _NAMENO 284
     113#define _NAMELIST 285
     114#define _RULESECTION 286
     115#define _RULE 287
     116#define _LHS 288
     117#define _RHS 289
     118#define _PREC 290
     119#define _ACTION 291
     120#define _USERSECTION_OPT 292
     121
     122/* Value type.  */
     123#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
     124
     125union YYSTYPE
     126{
     127#line 41 "parser.yy" /* yacc.c:1909  */
     128
     129        Token *tokenp;
     130
     131#line 132 "parser.hh" /* yacc.c:1909  */
     132};
     133
     134typedef union YYSTYPE YYSTYPE;
     135# define YYSTYPE_IS_TRIVIAL 1
     136# define YYSTYPE_IS_DECLARED 1
     137#endif
     138
     139
     140extern YYSTYPE yylval;
     141
     142int yyparse (void);
     143
     144#endif /* !YY_YY_PARSER_HH_INCLUDED  */
  • tools/prettyprinter/parser.yy

    r44f44617 r8c97ee7  
    2020#include <iostream>
    2121using namespace std;
    22 #include "parser.hh"
     22#include "ParserTypes.h"
    2323#include "filter.h"
    2424
  • tools/prettyprinter/token.cc

    r44f44617 r8c97ee7  
    1616#include <string>
    1717using namespace std;
    18 #include "parser.hh"
    19 #include "parser.h"
     18#include "ParserTypes.h"
     19#include "parser.hh"
    2020#include "filter.h"
    2121
Note: See TracChangeset for help on using the changeset viewer.