Clan  0.8.0
Data Structures | Defines | Typedefs | Enumerations | Functions | Variables
parser.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <osl/macros.h>
#include <osl/int.h>
#include <osl/vector.h>
#include <osl/relation.h>
#include <osl/statement.h>
#include <osl/strings.h>
#include <osl/generic.h>
#include <osl/body.h>
#include <osl/extensions/arrays.h>
#include <osl/extensions/extbody.h>
#include <osl/scop.h>
#include <clan/macros.h>
#include <clan/vector.h>
#include <clan/relation.h>
#include <clan/relation_list.h>
#include <clan/scop.h>
#include <clan/symbol.h>
#include <clan/statement.h>
#include <clan/options.h>
Include dependency graph for parser.c:

Go to the source code of this file.

Data Structures

union  YYSTYPE
union  yyalloc

Defines

#define YYBISON   1
#define YYBISON_VERSION   "2.5"
#define YYSKELETON_NAME   "yacc.c"
#define YYPURE   0
#define YYPUSH   0
#define YYPULL   1
#define YYLSP_NEEDED   0
#define YYDEBUG   0
#define YYERROR_VERBOSE   0
#define YYTOKEN_TABLE   0
#define YYTOKENTYPE
#define CONSTANT   258
#define STRING_LITERAL   259
#define SIZEOF   260
#define PTR_OP   261
#define INC_OP   262
#define DEC_OP   263
#define LEFT_OP   264
#define RIGHT_OP   265
#define LE_OP   266
#define GE_OP   267
#define EQ_OP   268
#define NE_OP   269
#define AND_OP   270
#define OR_OP   271
#define MUL_ASSIGN   272
#define DIV_ASSIGN   273
#define MOD_ASSIGN   274
#define ADD_ASSIGN   275
#define SUB_ASSIGN   276
#define LEFT_ASSIGN   277
#define RIGHT_ASSIGN   278
#define AND_ASSIGN   279
#define XOR_ASSIGN   280
#define OR_ASSIGN   281
#define TYPE_NAME   282
#define TYPEDEF   283
#define EXTERN   284
#define STATIC   285
#define AUTO   286
#define REGISTER   287
#define INLINE   288
#define RESTRICT   289
#define CHAR   290
#define SHORT   291
#define INT   292
#define LONG   293
#define SIGNED   294
#define UNSIGNED   295
#define FLOAT   296
#define DOUBLE   297
#define CONST   298
#define VOLATILE   299
#define VOID   300
#define BOOL   301
#define COMPLEX   302
#define IMAGINARY   303
#define STRUCT   304
#define UNION   305
#define ENUM   306
#define ELLIPSIS   307
#define CASE   308
#define DEFAULT   309
#define IF   310
#define ELSE   311
#define SWITCH   312
#define WHILE   313
#define DO   314
#define FOR   315
#define GOTO   316
#define CONTINUE   317
#define BREAK   318
#define RETURN   319
#define IGNORE   320
#define PRAGMA   321
#define MIN   322
#define MAX   323
#define CEILD   324
#define FLOORD   325
#define ID   326
#define INTEGER   327
#define YYSTYPE_IS_TRIVIAL   1
#define yystype   YYSTYPE /* obsolescent; will be withdrawn */
#define YYSTYPE_IS_DECLARED   1
#define YYSIZE_T   unsigned int
#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)
#define YY_(msgid)   msgid
#define YYUSE(e)   ((void) (e))
#define YYID(n)   (n)
#define YYSTACK_ALLOC   YYMALLOC
#define YYSTACK_FREE   YYFREE
#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM
#define YYMALLOC   malloc
#define YYFREE   free
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY_NEEDED   1
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define YYCOPY(To, From, Count)
#define YYFINAL   7
#define YYLAST   740
#define YYNTOKENS   97
#define YYNNTS   91
#define YYNRULES   252
#define YYNSTATES   426
#define YYUNDEFTOK   2
#define YYMAXUTOK   327
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYPACT_NINF   -261
#define YYTABLE_NINF   -85
#define yypact_value_is_default(yystate)   ((yystate) == (-261))
#define yytable_value_is_error(yytable_value)   YYID (0)
#define yyerrok   (yyerrstatus = 0)
#define yyclearin   (yychar = YYEMPTY)
#define YYEMPTY   (-2)
#define YYEOF   0
#define YYACCEPT   goto yyacceptlab
#define YYABORT   goto yyabortlab
#define YYERROR   goto yyerrorlab
#define YYFAIL   goto yyerrlab
#define YYRECOVERING()   (!!yyerrstatus)
#define YYBACKUP(Token, Value)
#define YYTERROR   1
#define YYERRCODE   256
#define YYRHSLOC(Rhs, K)   ((Rhs)[K])
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YY_LOCATION_PRINT(File, Loc)   ((void) 0)
#define YYLEX   yylex ()
#define YYDPRINTF(Args)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#define YY_STACK_PRINT(Bottom, Top)
#define YY_REDUCE_PRINT(Rule)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))

Typedefs

typedef union YYSTYPE YYSTYPE
typedef unsigned char yytype_uint8
typedef short int yytype_int8
typedef unsigned short int yytype_uint16
typedef short int yytype_int16

Enumerations

enum  yytokentype {
  CONSTANT = 258, STRING_LITERAL = 259, SIZEOF = 260, PTR_OP = 261,
  INC_OP = 262, DEC_OP = 263, LEFT_OP = 264, RIGHT_OP = 265,
  LE_OP = 266, GE_OP = 267, EQ_OP = 268, NE_OP = 269,
  AND_OP = 270, OR_OP = 271, MUL_ASSIGN = 272, DIV_ASSIGN = 273,
  MOD_ASSIGN = 274, ADD_ASSIGN = 275, SUB_ASSIGN = 276, LEFT_ASSIGN = 277,
  RIGHT_ASSIGN = 278, AND_ASSIGN = 279, XOR_ASSIGN = 280, OR_ASSIGN = 281,
  TYPE_NAME = 282, TYPEDEF = 283, EXTERN = 284, STATIC = 285,
  AUTO = 286, REGISTER = 287, INLINE = 288, RESTRICT = 289,
  CHAR = 290, SHORT = 291, INT = 292, LONG = 293,
  SIGNED = 294, UNSIGNED = 295, FLOAT = 296, DOUBLE = 297,
  CONST = 298, VOLATILE = 299, VOID = 300, BOOL = 301,
  COMPLEX = 302, IMAGINARY = 303, STRUCT = 304, UNION = 305,
  ENUM = 306, ELLIPSIS = 307, CASE = 308, DEFAULT = 309,
  IF = 310, ELSE = 311, SWITCH = 312, WHILE = 313,
  DO = 314, FOR = 315, GOTO = 316, CONTINUE = 317,
  BREAK = 318, RETURN = 319, IGNORE = 320, PRAGMA = 321,
  MIN = 322, MAX = 323, CEILD = 324, FLOORD = 325,
  ID = 326, INTEGER = 327, CONSTANT = 258, STRING_LITERAL = 259,
  SIZEOF = 260, PTR_OP = 261, INC_OP = 262, DEC_OP = 263,
  LEFT_OP = 264, RIGHT_OP = 265, LE_OP = 266, GE_OP = 267,
  EQ_OP = 268, NE_OP = 269, AND_OP = 270, OR_OP = 271,
  MUL_ASSIGN = 272, DIV_ASSIGN = 273, MOD_ASSIGN = 274, ADD_ASSIGN = 275,
  SUB_ASSIGN = 276, LEFT_ASSIGN = 277, RIGHT_ASSIGN = 278, AND_ASSIGN = 279,
  XOR_ASSIGN = 280, OR_ASSIGN = 281, TYPE_NAME = 282, TYPEDEF = 283,
  EXTERN = 284, STATIC = 285, AUTO = 286, REGISTER = 287,
  INLINE = 288, RESTRICT = 289, CHAR = 290, SHORT = 291,
  INT = 292, LONG = 293, SIGNED = 294, UNSIGNED = 295,
  FLOAT = 296, DOUBLE = 297, CONST = 298, VOLATILE = 299,
  VOID = 300, BOOL = 301, COMPLEX = 302, IMAGINARY = 303,
  STRUCT = 304, UNION = 305, ENUM = 306, ELLIPSIS = 307,
  CASE = 308, DEFAULT = 309, IF = 310, ELSE = 311,
  SWITCH = 312, WHILE = 313, DO = 314, FOR = 315,
  GOTO = 316, CONTINUE = 317, BREAK = 318, RETURN = 319,
  IGNORE = 320, PRAGMA = 321, MIN = 322, MAX = 323,
  CEILD = 324, FLOORD = 325, ID = 326, INTEGER = 327
}

Functions

int yylex (void)
void yyerror (char *)
void yyrestart (FILE *)
void clan_scanner_initialize ()
void clan_scanner_reinitialize (int, int, int)
void clan_scanner_free ()
void clan_parser_add_ld ()
int clan_parser_nb_ld ()
void clan_parser_log (char *)
void clan_parser_increment_loop_depth ()
void clan_parser_state_initialize (clan_options_p)
osl_scop_p clan_parse (FILE *, clan_options_p)
static void yydestruct (char *yymsg, int yytype, YYSTYPE *yyvaluep) const
int yyparse ()
void clan_parser_state_malloc (int precision)
void clan_parser_state_free ()
void clan_parser_reinitialize ()
void clan_parser_autoscop ()

Variables

FILE * yyin = (FILE *) 0
int scanner_parsing
char * scanner_latest_text
char * scanner_clay
int scanner_line
int scanner_column
int scanner_column_LALR
int scanner_scop_start
int scanner_scop_end
int scanner_pragma
osl_scop_p parser_scop
clan_symbol_p parser_symbol
int parser_recording
char * parser_record
int parser_loop_depth
int parser_if_depth
int * parser_scattering
clan_symbol_pparser_iterators
osl_relation_list_p parser_stack
int * parser_nb_local_dims
int parser_nb_parameters
int * parser_valid_else
int parser_indent
int parser_error
int parser_ceild
int parser_floord
int parser_min
int parser_max
int parser_autoscop
int parser_line_start
int parser_line_end
int parser_column_start
int parser_column_end
clan_options_p parser_options
osl_extbody_p parser_access_extbody
int parser_access_start
int parser_access_length
static const yytype_uint8 yytranslate []
static const yytype_uint8 yyr1 []
static const yytype_uint8 yyr2 []
static const yytype_uint8 yydefact []
static const yytype_int16 yydefgoto []
static const yytype_int16 yypact []
static const yytype_int16 yypgoto []
static const yytype_int16 yytable []
static const yytype_int16 yycheck []
static const yytype_uint8 yystos []
int yychar
YYSTYPE yylval
int yynerrs

Define Documentation

#define ADD_ASSIGN   275

Definition at line 277 of file parser.c.

#define AND_ASSIGN   279

Definition at line 281 of file parser.c.

#define AND_OP   270

Definition at line 272 of file parser.c.

#define AUTO   286

Definition at line 288 of file parser.c.

#define BOOL   301

Definition at line 303 of file parser.c.

#define BREAK   318

Definition at line 320 of file parser.c.

#define CASE   308

Definition at line 310 of file parser.c.

#define CEILD   324

Definition at line 326 of file parser.c.

#define CHAR   290

Definition at line 292 of file parser.c.

#define COMPLEX   302

Definition at line 304 of file parser.c.

#define CONST   298

Definition at line 300 of file parser.c.

#define CONSTANT   258

Definition at line 260 of file parser.c.

#define CONTINUE   317

Definition at line 319 of file parser.c.

#define DEC_OP   263

Definition at line 265 of file parser.c.

#define DEFAULT   309

Definition at line 311 of file parser.c.

#define DIV_ASSIGN   273

Definition at line 275 of file parser.c.

#define DO   314

Definition at line 316 of file parser.c.

#define DOUBLE   297

Definition at line 299 of file parser.c.

#define ELLIPSIS   307

Definition at line 309 of file parser.c.

#define ELSE   311

Definition at line 313 of file parser.c.

#define ENUM   306

Definition at line 308 of file parser.c.

#define EQ_OP   268

Definition at line 270 of file parser.c.

#define EXTERN   284

Definition at line 286 of file parser.c.

#define FLOAT   296

Definition at line 298 of file parser.c.

#define FLOORD   325

Definition at line 327 of file parser.c.

#define FOR   315

Definition at line 317 of file parser.c.

#define GE_OP   267

Definition at line 269 of file parser.c.

#define GOTO   316

Definition at line 318 of file parser.c.

#define ID   326

Definition at line 328 of file parser.c.

#define IF   310

Definition at line 312 of file parser.c.

#define IGNORE   320

Definition at line 322 of file parser.c.

Referenced by clan_scanner().

#define IMAGINARY   303

Definition at line 305 of file parser.c.

#define INC_OP   262

Definition at line 264 of file parser.c.

#define INLINE   288

Definition at line 290 of file parser.c.

#define INT   292

Definition at line 294 of file parser.c.

#define INTEGER   327

Definition at line 329 of file parser.c.

#define LE_OP   266

Definition at line 268 of file parser.c.

#define LEFT_ASSIGN   277

Definition at line 279 of file parser.c.

#define LEFT_OP   264

Definition at line 266 of file parser.c.

#define LONG   293

Definition at line 295 of file parser.c.

#define MAX   323

Definition at line 325 of file parser.c.

#define MIN   322

Definition at line 324 of file parser.c.

#define MOD_ASSIGN   274

Definition at line 276 of file parser.c.

#define MUL_ASSIGN   272

Definition at line 274 of file parser.c.

#define NE_OP   269

Definition at line 271 of file parser.c.

#define OR_ASSIGN   281

Definition at line 283 of file parser.c.

#define OR_OP   271

Definition at line 273 of file parser.c.

#define PRAGMA   321

Definition at line 323 of file parser.c.

#define PTR_OP   261

Definition at line 263 of file parser.c.

#define REGISTER   287

Definition at line 289 of file parser.c.

#define RESTRICT   289

Definition at line 291 of file parser.c.

#define RETURN   319

Definition at line 321 of file parser.c.

#define RIGHT_ASSIGN   278

Definition at line 280 of file parser.c.

#define RIGHT_OP   265

Definition at line 267 of file parser.c.

#define SHORT   291

Definition at line 293 of file parser.c.

#define SIGNED   294

Definition at line 296 of file parser.c.

#define SIZEOF   260

Definition at line 262 of file parser.c.

#define STATIC   285

Definition at line 287 of file parser.c.

#define STRING_LITERAL   259

Definition at line 261 of file parser.c.

#define STRUCT   304

Definition at line 306 of file parser.c.

#define SUB_ASSIGN   276

Definition at line 278 of file parser.c.

#define SWITCH   312

Definition at line 314 of file parser.c.

#define TYPE_NAME   282

Definition at line 284 of file parser.c.

#define TYPEDEF   283

Definition at line 285 of file parser.c.

#define UNION   305

Definition at line 307 of file parser.c.

#define UNSIGNED   295

Definition at line 297 of file parser.c.

#define VOID   300

Definition at line 302 of file parser.c.

#define VOLATILE   299

Definition at line 301 of file parser.c.

#define WHILE   313

Definition at line 315 of file parser.c.

#define XOR_ASSIGN   280

Definition at line 282 of file parser.c.

#define YY_ (   msgid)    msgid

Definition at line 419 of file parser.c.

Referenced by yyparse().

#define YY_LOCATION_PRINT (   File,
  Loc 
)    ((void) 0)

Definition at line 1340 of file parser.c.

#define YY_REDUCE_PRINT (   Rule)

Definition at line 1512 of file parser.c.

Referenced by yyparse().

#define YY_STACK_PRINT (   Bottom,
  Top 
)

Definition at line 1511 of file parser.c.

Referenced by yyparse().

#define YY_SYMBOL_PRINT (   Title,
  Type,
  Value,
  Location 
)

Definition at line 1510 of file parser.c.

Referenced by yydestruct(), and yyparse().

#define YYABORT   goto yyabortlab

Definition at line 1269 of file parser.c.

Referenced by yyparse().

#define YYACCEPT   goto yyacceptlab

Definition at line 1268 of file parser.c.

Referenced by yyparse().

#define YYBACKUP (   Token,
  Value 
)
Value:
do                                                              \
  if (yychar == YYEMPTY && yylen == 1)                          \
    {                                                           \
      yychar = (Token);                                         \
      yylval = (Value);                                         \
      YYPOPSTACK (1);                                           \
      goto yybackup;                                            \
    }                                                           \
  else                                                          \
    {                                                           \
      yyerror (YY_("syntax error: cannot back up")); \
      YYERROR;                                                  \
    }                                                           \
while (YYID (0))

Definition at line 1290 of file parser.c.

#define YYBISON   1

Definition at line 44 of file parser.c.

#define YYBISON_VERSION   "2.5"

Definition at line 47 of file parser.c.

#define yyclearin   (yychar = YYEMPTY)

Definition at line 1264 of file parser.c.

#define YYCOPY (   To,
  From,
  Count 
)
Value:
do                                      \
        {                                       \
          YYSIZE_T yyi;                         \
          for (yyi = 0; yyi < (Count); yyi++)   \
            (To)[yyi] = (From)[yyi];            \
        }                                       \
      while (YYID (0))

Definition at line 566 of file parser.c.

#define YYCOPY_NEEDED   1

Definition at line 538 of file parser.c.

#define YYDEBUG   0

Definition at line 164 of file parser.c.

#define YYDPRINTF (   Args)

Definition at line 1509 of file parser.c.

Referenced by yyparse().

#define YYEMPTY   (-2)

Definition at line 1265 of file parser.c.

Referenced by yyparse().

#define YYEOF   0

Definition at line 1266 of file parser.c.

Referenced by yyparse().

#define YYERRCODE   256

Definition at line 1308 of file parser.c.

#define yyerrok   (yyerrstatus = 0)

Definition at line 1263 of file parser.c.

#define YYERROR   goto yyerrorlab

Definition at line 1270 of file parser.c.

#define YYERROR_VERBOSE   0

Definition at line 172 of file parser.c.

#define YYFAIL   goto yyerrlab

Definition at line 1280 of file parser.c.

#define YYFINAL   7

Definition at line 579 of file parser.c.

Referenced by yyparse().

#define YYFREE   free

Definition at line 508 of file parser.c.

#define YYID (   n)    (n)

Definition at line 432 of file parser.c.

Referenced by yyparse().

#define YYINITDEPTH   200

Definition at line 1518 of file parser.c.

Referenced by yyparse().

#define YYLAST   740

Definition at line 581 of file parser.c.

Referenced by yyparse().

#define YYLEX   yylex ()

Definition at line 1349 of file parser.c.

Referenced by yyparse().

#define YYLLOC_DEFAULT (   Current,
  Rhs,
 
)
Value:
do                                                                      \
      if (YYID (N))                                                    \
        {                                                               \
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
        }                                                               \
      else                                                              \
        {                                                               \
          (Current).first_line   = (Current).last_line   =              \
            YYRHSLOC (Rhs, 0).last_line;                                \
          (Current).first_column = (Current).last_column =              \
            YYRHSLOC (Rhs, 0).last_column;                              \
        }                                                               \
    while (YYID (0))

Definition at line 1317 of file parser.c.

#define YYLSP_NEEDED   0

Definition at line 62 of file parser.c.

#define YYMALLOC   malloc

Definition at line 501 of file parser.c.

#define YYMAXDEPTH   10000

Definition at line 1529 of file parser.c.

Referenced by yyparse().

#define YYMAXUTOK   327

Definition at line 594 of file parser.c.

#define YYNNTS   91

Definition at line 586 of file parser.c.

#define YYNRULES   252

Definition at line 588 of file parser.c.

#define YYNSTATES   426

Definition at line 590 of file parser.c.

#define YYNTOKENS   97

Definition at line 584 of file parser.c.

Referenced by yyparse().

#define YYPACT_NINF   -261

Definition at line 983 of file parser.c.

#define yypact_value_is_default (   yystate)    ((yystate) == (-261))

Definition at line 1129 of file parser.c.

Referenced by yyparse().

#define YYPOPSTACK (   N)    (yyvsp -= (N), yyssp -= (N))

Referenced by yyparse().

#define YYPULL   1

Definition at line 59 of file parser.c.

#define YYPURE   0

Definition at line 53 of file parser.c.

#define YYPUSH   0

Definition at line 56 of file parser.c.

#define YYRECOVERING ( )    (!!yyerrstatus)

Definition at line 1288 of file parser.c.

#define YYRHSLOC (   Rhs,
 
)    ((Rhs)[K])

Definition at line 1315 of file parser.c.

#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)

Definition at line 409 of file parser.c.

#define YYSIZE_T   unsigned int

Definition at line 405 of file parser.c.

Referenced by yyparse().

#define YYSKELETON_NAME   "yacc.c"

Definition at line 50 of file parser.c.

#define YYSTACK_ALLOC   YYMALLOC

Definition at line 487 of file parser.c.

Referenced by yyparse().

Definition at line 490 of file parser.c.

#define YYSTACK_BYTES (   N)
Value:
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
      + YYSTACK_GAP_MAXIMUM)

Definition at line 534 of file parser.c.

Referenced by yyparse().

#define YYSTACK_FREE   YYFREE

Definition at line 488 of file parser.c.

Referenced by yyparse().

#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)

Definition at line 530 of file parser.c.

#define YYSTACK_RELOCATE (   Stack_alloc,
  Stack 
)
Value:
do                                                                      \
      {                                                                 \
        YYSIZE_T yynewbytes;                                            \
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
        Stack = &yyptr->Stack_alloc;                                    \
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / sizeof (*yyptr);                          \
      }                                                                 \
    while (YYID (0))

Definition at line 545 of file parser.c.

Referenced by yyparse().

#define yystype   YYSTYPE /* obsolescent; will be withdrawn */

Definition at line 353 of file parser.c.

#define YYSTYPE_IS_DECLARED   1

Definition at line 354 of file parser.c.

#define YYSTYPE_IS_TRIVIAL   1

Definition at line 352 of file parser.c.

#define YYTABLE_NINF   -85

Definition at line 1049 of file parser.c.

#define yytable_value_is_error (   yytable_value)    YYID (0)

Definition at line 1132 of file parser.c.

Referenced by yyparse().

#define YYTERROR   1

Definition at line 1307 of file parser.c.

Referenced by yyparse().

#define YYTOKEN_TABLE   0

Definition at line 177 of file parser.c.

#define YYTOKENTYPE

Definition at line 183 of file parser.c.

#define YYTRANSLATE (   YYX)    ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

Definition at line 596 of file parser.c.

Referenced by yyparse().

#define YYUNDEFTOK   2

Definition at line 593 of file parser.c.

#define YYUSE (   e)    ((void) (e))

Definition at line 425 of file parser.c.

Referenced by yydestruct().


Typedef Documentation

typedef union YYSTYPE YYSTYPE
typedef short int yytype_int16

Definition at line 392 of file parser.c.

typedef short int yytype_int8

Definition at line 380 of file parser.c.

typedef unsigned short int yytype_uint16

Definition at line 386 of file parser.c.

typedef unsigned char yytype_uint8

Definition at line 371 of file parser.c.


Enumeration Type Documentation

Enumerator:
CONSTANT 
STRING_LITERAL 
SIZEOF 
PTR_OP 
INC_OP 
DEC_OP 
LEFT_OP 
RIGHT_OP 
LE_OP 
GE_OP 
EQ_OP 
NE_OP 
AND_OP 
OR_OP 
MUL_ASSIGN 
DIV_ASSIGN 
MOD_ASSIGN 
ADD_ASSIGN 
SUB_ASSIGN 
LEFT_ASSIGN 
RIGHT_ASSIGN 
AND_ASSIGN 
XOR_ASSIGN 
OR_ASSIGN 
TYPE_NAME 
TYPEDEF 
EXTERN 
STATIC 
AUTO 
REGISTER 
INLINE 
RESTRICT 
CHAR 
SHORT 
INT 
LONG 
SIGNED 
UNSIGNED 
FLOAT 
DOUBLE 
CONST 
VOLATILE 
VOID 
BOOL 
COMPLEX 
IMAGINARY 
STRUCT 
UNION 
ENUM 
ELLIPSIS 
CASE 
DEFAULT 
IF 
ELSE 
SWITCH 
WHILE 
DO 
FOR 
GOTO 
CONTINUE 
BREAK 
RETURN 
IGNORE 
PRAGMA 
MIN 
MAX 
CEILD 
FLOORD 
ID 
INTEGER 
CONSTANT 
STRING_LITERAL 
SIZEOF 
PTR_OP 
INC_OP 
DEC_OP 
LEFT_OP 
RIGHT_OP 
LE_OP 
GE_OP 
EQ_OP 
NE_OP 
AND_OP 
OR_OP 
MUL_ASSIGN 
DIV_ASSIGN 
MOD_ASSIGN 
ADD_ASSIGN 
SUB_ASSIGN 
LEFT_ASSIGN 
RIGHT_ASSIGN 
AND_ASSIGN 
XOR_ASSIGN 
OR_ASSIGN 
TYPE_NAME 
TYPEDEF 
EXTERN 
STATIC 
AUTO 
REGISTER 
INLINE 
RESTRICT 
CHAR 
SHORT 
INT 
LONG 
SIGNED 
UNSIGNED 
FLOAT 
DOUBLE 
CONST 
VOLATILE 
VOID 
BOOL 
COMPLEX 
IMAGINARY 
STRUCT 
UNION 
ENUM 
ELLIPSIS 
CASE 
DEFAULT 
IF 
ELSE 
SWITCH 
WHILE 
DO 
FOR 
GOTO 
CONTINUE 
BREAK 
RETURN 
IGNORE 
PRAGMA 
MIN 
MAX 
CEILD 
FLOORD 
ID 
INTEGER 

Definition at line 186 of file parser.c.


Function Documentation

osl_scop_p clan_parse ( FILE *  input,
clan_options_p  options 
)

clan_parse function: this function parses a file to extract a SCoP and returns, if successful, a pointer to the osl_scop_t structure.

Parameters:
inputThe file to parse (already open).
optionsOptions for file parsing.

Definition at line 4810 of file parser.c.

References clan_options::autoscop, CLAN_debug, clan_parser_autoscop(), clan_parser_state_free(), clan_parser_state_initialize(), clan_parser_state_malloc(), clan_scanner_free(), clan_scanner_initialize(), parser_error, parser_scop, clan_options::precision, yyin, yyparse(), and yyrestart().

Referenced by clan_scop_extract().

void clan_parser_add_ld ( void  )

clan_parser_autoscop function: this functions performs the automatic extraction of SCoPs from the input file. It leaves the SCoP pragmas already set by the user intact (note that as a consequence, user-SCoPs cannot be inserted to a larger SCoP). It writes a file (named by the CLAN_AUTOPRAGMA_FILE macro) with the input code where new SCoP pragmas have been inserted. If the option -autoscop is set, it puts the list of SCoPs (including automatically discovered SCoPs and user-SCoPs) in parser_scop.

Definition at line 4689 of file parser.c.

References clan_options::autoscop, CLAN_AUTOPRAGMA_FILE, CLAN_DEBUG, CLAN_error, CLAN_FALSE, CLAN_MAX_SCOPS, clan_parser_reinitialize(), clan_scanner_free(), clan_scanner_reinitialize(), clan_scop_print_autopragma(), clan_scop_update_coordinates(), CLAN_TRUE, CLAN_UNDEFINED, CLAN_warning, parser_autoscop, parser_column_end, parser_column_start, parser_error, parser_line_end, parser_line_start, parser_scop, scanner_column, scanner_line, scanner_parsing, scanner_pragma, scanner_scop_end, scanner_scop_start, yyin, yyparse(), and yyrestart().

Referenced by clan_parse().

Definition at line 4580 of file parser.c.

References CLAN_error, CLAN_MAX_DEPTH, parser_if_depth, and parser_loop_depth.

Referenced by yyparse().

void clan_parser_log ( char *  )
int clan_parser_nb_ld ( void  )

clan_parser_reinitialize function: this function frees the temporary dynamic variables of the parser and reset the variables to default values. It is meant to be used for a clean restart after a parse error.

Definition at line 4665 of file parser.c.

References clan_parser_state_initialize(), clan_symbol_free(), parser_loop_depth, parser_record, parser_scop, and parser_stack.

Referenced by clan_parser_autoscop().

clan_parser_state_free function: this function frees the memory allocated for the "parser state", with the exception of the parser_scop.

Definition at line 4612 of file parser.c.

References clan_symbol_free(), parser_nb_local_dims, parser_scattering, parser_stack, and parser_valid_else.

Referenced by clan_parse().

void clan_parser_state_malloc ( int  precision)

clan_parser_state_malloc function: this function achieves the memory allocation for the "parser state".

Parameters:
[in]precisionPrecision of the integer elements.

Definition at line 4592 of file parser.c.

References CLAN_malloc, CLAN_MAX_DEPTH, CLAN_MAX_LOCAL_DIMS, CLAN_MAX_PARAMETERS, parser_nb_local_dims, parser_scattering, parser_stack, and parser_valid_else.

Referenced by clan_parse().

clan_scanner_free function: this function frees the memory allocated for the scanner. It frees flex's buffer (it supposes there is only one buffer) since flex does never free it itself. WARNING: this is probably not portable...

Definition at line 2799 of file scanner.c.

References YY_CURRENT_BUFFER, and yy_delete_buffer().

Referenced by clan_parse(), and clan_parser_autoscop().

clan_scanner_initialize function: this function initialises the scanner global variables with default values.

Definition at line 2735 of file scanner.c.

References CLAN_FALSE, CLAN_malloc, CLAN_UNDEFINED, yy_buffer_stack_top, YY_CURRENT_BUFFER, and yy_flush_buffer().

Referenced by clan_parse(), and clan_scanner_reinitialize().

void clan_scanner_reinitialize ( int  pragma,
int  line,
int  column 
)

clan_scanner_reinitialize function: this function frees the temporary dynamic variables of the scanner and and reset the variables to default or input values. It is meant to be used for a clean restart after a parse error.

Parameters:
[in]pragmaThe initialization value of scanner_pragma.
[in]lineThe initialization value of scanner_line.
[in]columnThe initialization value of scanner_column.

Definition at line 2763 of file scanner.c.

References clan_scanner_initialize().

Referenced by clan_parser_autoscop().

static void yydestruct ( char *  yymsg,
int  yytype,
YYSTYPE yyvaluep 
) const [static]

Definition at line 1782 of file parser.c.

References YYSTYPE::affex, YYSTYPE::list, YYSTYPE::stmt, YYSTYPE::symbol, YY_SYMBOL_PRINT, and YYUSE.

Referenced by yyparse().

void yyerror ( char *  s)
int yylex ( void  )
int yyparse ( )

Definition at line 2174 of file parser.c.

References YYSTYPE::affex, clan_options::autoscop, CLAN_DEBUG, CLAN_debug, CLAN_debug_call, CLAN_error, CLAN_FALSE, CLAN_MAX_DEPTH, CLAN_MAX_LOCAL_DIMS, CLAN_MAX_PARAMETERS, clan_parser_add_ld(), clan_parser_increment_loop_depth(), clan_parser_nb_ld(), clan_parser_state_initialize(), clan_relation_and(), clan_relation_build_context(), clan_relation_existential(), clan_relation_greater(), clan_relation_list_define_type(), clan_relation_loop_context(), clan_relation_new_output_scalar(), clan_relation_new_output_vector(), clan_relation_not(), clan_relation_scattering(), clan_relation_stride(), clan_relation_tag_array(), clan_scop_compact(), clan_scop_generate_clay(), clan_scop_generate_coordinates(), clan_scop_generate_scatnames(), clan_scop_simplify(), CLAN_strdup, clan_symbol_add(), clan_symbol_array_to_strings(), clan_symbol_free(), clan_symbol_nb_of_type(), clan_symbol_new_iterator(), clan_symbol_to_arrays(), clan_symbol_to_strings(), clan_symbol_update_type(), CLAN_TRUE, CLAN_TYPE_ARRAY, CLAN_TYPE_FIELD, CLAN_TYPE_FUNCTION, CLAN_TYPE_ITERATOR, CLAN_TYPE_PARAMETER, CLAN_TYPE_RDWR, CLAN_TYPE_WRITE, CLAN_UNDEFINED, clan_vector_term(), clan_options::extbody, clan_symbol::key, YYSTYPE::list, clan_options::name, clan_options::noloopcontext, clan_options::nosimplify, parser_access_extbody, parser_access_length, parser_access_start, parser_autoscop, parser_ceild, parser_column_end, parser_column_start, parser_floord, parser_if_depth, parser_indent, parser_line_end, parser_line_start, parser_loop_depth, parser_max, parser_min, parser_nb_local_dims, parser_nb_parameters, parser_record, parser_recording, parser_scattering, parser_scop, parser_stack, parser_valid_else, clan_options::precision, scanner_clay, scanner_column, scanner_column_LALR, scanner_latest_text, scanner_line, YYSTYPE::setex, YYSTYPE::stmt, YYSTYPE::symbol, clan_symbol::type, YYSTYPE::value, YY_, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yydestruct(), YYDPRINTF, YYEMPTY, YYEOF, yyerror(), YYFINAL, YYID, YYINITDEPTH, YYLAST, YYLEX, yylval, YYMAXDEPTH, yynerrs, YYNTOKENS, yypact_value_is_default, YYPOPSTACK, YYSIZE_T, yyalloc::yyss_alloc, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, yytable_value_is_error, YYTERROR, YYTRANSLATE, and yyalloc::yyvs_alloc.

Referenced by clan_parse(), and clan_parser_autoscop().

void yyrestart ( FILE *  )

Referenced by clan_parse(), and clan_parser_autoscop().


Variable Documentation

osl_extbody_p parser_access_extbody

The extbody struct

Definition at line 154 of file parser.c.

Referenced by yyparse().

Length of the access string

Definition at line 156 of file parser.c.

Referenced by yyparse().

Start coordinates

Definition at line 155 of file parser.c.

Referenced by yyparse().

Boolean: autoscop in progress

Definition at line 144 of file parser.c.

Referenced by clan_parser_autoscop(), clan_parser_state_initialize(), and yyparse().

Boolean: ceild used

Definition at line 138 of file parser.c.

Referenced by clan_parser_state_initialize(), and yyparse().

Autoscop end column, exclusive

Definition at line 148 of file parser.c.

Referenced by clan_parser_autoscop(), clan_parser_state_initialize(), and yyparse().

Autoscop start column, inclus.

Definition at line 147 of file parser.c.

Referenced by clan_parser_autoscop(), clan_parser_state_initialize(), and yyparse().

Boolean: parse error

Definition at line 136 of file parser.c.

Referenced by clan_parse(), clan_parser_autoscop(), clan_parser_state_initialize(), and yyerror().

Boolean: floord used

Definition at line 139 of file parser.c.

Referenced by clan_parser_state_initialize(), and yyparse().

SCoP indentation

Definition at line 135 of file parser.c.

Referenced by clan_parser_state_initialize(), clan_scop_generate_coordinates(), and yyparse().

Current iterator list

Definition at line 130 of file parser.c.

Autoscop end line, inclusive

Definition at line 146 of file parser.c.

Referenced by clan_parser_autoscop(), clan_parser_state_initialize(), and yyparse().

Autoscop start line, inclusive

Definition at line 145 of file parser.c.

Referenced by clan_parser_autoscop(), clan_parser_state_initialize(), and yyparse().

Boolean: max used

Definition at line 141 of file parser.c.

Referenced by clan_parser_state_initialize(), and yyparse().

Boolean: min used

Definition at line 140 of file parser.c.

Referenced by clan_parser_state_initialize(), and yyparse().

Nb of parameter symbols

Definition at line 133 of file parser.c.

Referenced by clan_parser_state_initialize(), and yyparse().

Clan options

Definition at line 151 of file parser.c.

What we record (statement body)

Definition at line 126 of file parser.c.

Referenced by clan_parser_reinitialize(), clan_parser_state_initialize(), and yyparse().

Boolean: do we record or not?

Definition at line 125 of file parser.c.

Referenced by clan_parser_state_initialize(), and yyparse().

Current statement scattering

Definition at line 129 of file parser.c.

Referenced by clan_parser_state_free(), clan_parser_state_initialize(), clan_parser_state_malloc(), and yyparse().

osl_scop_p parser_scop

SCoP in construction

Definition at line 123 of file parser.c.

Referenced by clan_parse(), clan_parser_autoscop(), clan_parser_reinitialize(), and yyparse().

osl_relation_list_p parser_stack

Iteration domain stack

Definition at line 131 of file parser.c.

Referenced by clan_parser_reinitialize(), clan_parser_state_free(), clan_parser_state_malloc(), and yyparse().

Top of the symbol table

Definition at line 124 of file parser.c.

Boolean: OK for else per depth

Definition at line 134 of file parser.c.

Referenced by clan_parser_state_free(), clan_parser_state_initialize(), clan_parser_state_malloc(), and yyparse().

char* scanner_clay

Data for the Clay software

Definition at line 779 of file scanner.c.

Referenced by yyparse().

Scanned column (current)

Current column number

Definition at line 781 of file scanner.c.

Referenced by clan_parser_autoscop(), clan_scanner_count(), yyerror(), and yyparse().

Scanned column (before token)

Column number before token

Definition at line 782 of file scanner.c.

Referenced by yyparse().

Latest text read by Lex

Latest text read

Definition at line 778 of file scanner.c.

Referenced by yyparse().

Current scanned line

Current line number

Definition at line 780 of file scanner.c.

Referenced by clan_parser_autoscop(), yyerror(), and yyparse().

Do we parse or not?

Definition at line 776 of file scanner.c.

Referenced by clan_parser_autoscop().

Between SCoP pragmas or not?

Definition at line 785 of file scanner.c.

Referenced by clan_parser_autoscop().

Scanned SCoP ending line

SCoP ending line

Definition at line 784 of file scanner.c.

Referenced by clan_parser_autoscop(), and clan_scop_generate_coordinates().

Scanned SCoP starting line

SCoP starting line

Definition at line 783 of file scanner.c.

Referenced by clan_parser_autoscop(), and clan_scop_generate_coordinates().

int yychar

Definition at line 2144 of file parser.c.

const yytype_int16 yycheck[] [static]

Definition at line 1135 of file parser.c.

const yytype_uint8 yydefact[] [static]

Definition at line 919 of file parser.c.

const yytype_int16 yydefgoto[] [static]
Initial value:
{
      -1,     2,     3,     4,     5,     6,   182,    16,    17,   379,
     403,    18,   241,   345,    26,   381,    85,   180,   305,   181,
     250,   302,   303,    27,   183,   389,   390,    71,    72,    73,
      74,    75,    76,    77,    78,    79,   392,   393,    80,    81,
      42,    43,   201,   286,   129,    45,    46,    47,    48,    49,
      50,    51,    52,    53,    54,    55,    56,    57,    58,    59,
     127,   128,   103,    19,    20,   281,   268,   269,   104,   105,
     106,   259,   260,   261,   316,   317,   108,   256,   257,   109,
     318,   319,   320,   278,   272,   273,   274,   400,   110,   275,
     196
}

Definition at line 967 of file parser.c.

FILE * yyin = (FILE *) 0

File to be read by Lex

Definition at line 340 of file scanner.c.

Referenced by clan_parse(), clan_parser_autoscop(), yy_init_globals(), yyget_in(), and yyset_in().

Definition at line 2147 of file parser.c.

Referenced by yyparse().

int yynerrs

Definition at line 2150 of file parser.c.

Referenced by yyparse().

const yytype_int16 yypact[] [static]

Definition at line 984 of file parser.c.

const yytype_int16 yypgoto[] [static]
Initial value:
{
    -261,  -261,   515,   536,    33,  -261,    -6,  -261,  -261,  -261,
    -261,  -261,  -261,  -261,  -261,  -261,  -261,  -261,  -261,  -261,
    -261,  -261,  -128,  -261,   172,  -153,  -261,  -148,  -144,   394,
     385,   -51,   344,   247,   248,   -66,  -261,  -261,  -261,  -261,
    -261,  -261,  -261,  -261,   -18,  -261,   512,   -38,   296,   311,
     225,   316,   417,   437,   427,   432,   438,  -261,  -179,  -124,
    -261,  -261,   -11,  -261,  -261,  -240,   124,  -261,  -149,  -261,
    -261,   324,  -232,   -22,  -261,   219,  -261,   332,   287,  -167,
    -242,     8,   -99,  -261,  -260,  -261,   256,  -261,   511,  -103,
    -184
}

Definition at line 1032 of file parser.c.

const yytype_uint8 yyr1[] [static]
Initial value:
{
       0,    97,    98,    98,    98,    98,    99,   100,   100,   102,
     101,   103,   103,   103,   104,   103,   105,   105,   107,   106,
     106,   109,   110,   108,   112,   111,   113,   111,   115,   114,
     116,   116,   117,   118,   118,   118,   118,   118,   118,   118,
     118,   119,   119,   120,   120,   121,   122,   122,   123,   123,
     124,   124,   125,   125,   126,   126,   126,   126,   126,   126,
     126,   126,   127,   127,   128,   128,   129,   129,   129,   130,
     130,   130,   131,   131,   131,   132,   132,   132,   133,   133,
     134,   134,   135,   135,   136,   136,   137,   137,   137,   137,
     137,   138,   138,   138,   139,   138,   138,   138,   138,   140,
     140,   141,   141,   141,   141,   141,   142,   142,   142,   142,
     142,   142,   143,   143,   144,   144,   145,   145,   145,   145,
     146,   146,   146,   147,   147,   147,   148,   148,   148,   148,
     148,   149,   149,   149,   150,   150,   151,   151,   152,   152,
     153,   153,   154,   154,   155,   155,   156,   156,   157,   157,
     158,   158,   158,   158,   158,   158,   158,   158,   158,   158,
     159,   159,   160,   161,   160,   162,   163,   163,   163,   163,
     163,   163,   164,   164,   164,   164,   164,   165,   165,   165,
     165,   165,   165,   165,   165,   165,   165,   165,   165,   166,
     166,   166,   167,   167,   168,   168,   169,   170,   170,   170,
     170,   171,   171,   172,   172,   172,   173,   173,   173,   174,
     174,   175,   175,   176,   176,   177,   177,   178,   178,   178,
     178,   178,   178,   178,   179,   179,   179,   179,   180,   180,
     181,   181,   182,   182,   183,   183,   183,   184,   184,   185,
     185,   186,   186,   186,   187,   187,   187,   187,   187,   187,
     187,   187,   187
}

Definition at line 855 of file parser.c.

const yytype_uint8 yyr2[] [static]
Initial value:
{
       0,     2,     1,     2,     2,     1,     2,     1,     2,     0,
       2,     1,     1,     1,     0,     2,     2,     3,     0,     3,
       0,     0,     0,     8,     0,     8,     0,     3,     0,     6,
       1,     0,     2,     2,     2,     2,     2,     5,     5,     3,
       3,     1,     3,     4,     5,     1,     1,     6,     1,     1,
       1,     6,     1,     6,     3,     3,     3,     3,     3,     3,
       4,     5,     1,     3,     1,     3,     1,     1,     3,     1,
       2,     2,     1,     3,     3,     1,     3,     3,     1,     6,
       1,     1,     1,     6,     1,     6,     1,     1,     1,     1,
       3,     1,     4,     3,     0,     5,     3,     3,     2,     1,
       3,     1,     2,     2,     2,     4,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     4,     1,     3,     3,     3,
       1,     3,     3,     1,     3,     3,     1,     3,     3,     3,
       3,     1,     3,     3,     1,     3,     1,     3,     1,     3,
       1,     3,     1,     3,     1,     5,     1,     3,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     3,     1,     0,     3,     1,     1,     2,     1,     2,
       1,     2,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     5,
       4,     2,     1,     1,     1,     2,     3,     2,     1,     2,
       1,     1,     3,     1,     2,     3,     4,     5,     2,     1,
       3,     1,     3,     1,     1,     2,     1,     1,     3,     4,
       3,     4,     4,     3,     1,     2,     2,     3,     1,     2,
       1,     3,     1,     3,     2,     2,     1,     1,     3,     1,
       2,     1,     1,     2,     3,     2,     3,     3,     4,     2,
       3,     3,     4
}

Definition at line 886 of file parser.c.

const yytype_uint8 yystos[] [static]

Definition at line 1216 of file parser.c.

const yytype_int16 yytable[] [static]

Definition at line 1050 of file parser.c.

const yytype_uint8 yytranslate[] [static]

Definition at line 600 of file parser.c.