Newer
Older
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
# endif
# define YYDPRINTF(Args) \
do { \
if (yydebug) \
YYFPRINTF Args; \
} while (0)
# define YYDSYMPRINT(Args) \
do { \
if (yydebug) \
yysymprint Args; \
} while (0)
# define YYDSYMPRINTF(Title, Token, Value, Location) \
do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yysymprint (stderr, \
Token, Value); \
YYFPRINTF (stderr, "\n"); \
} \
} while (0)
/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (cinluded). |
`------------------------------------------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
static void
yy_stack_print (short *bottom, short *top)
#else
static void
yy_stack_print (bottom, top)
short *bottom;
short *top;
{
YYFPRINTF (stderr, "Stack now");
for (/* Nothing. */; bottom <= top; ++bottom)
YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
# define YY_STACK_PRINT(Bottom, Top) \
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
} while (0)
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
static void
yy_reduce_print (int yyrule)
#else
static void
yy_reduce_print (yyrule)
int yyrule;
#endif
{
int yyi;
unsigned int yylineno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
yyrule - 1, yylineno);
/* Print the symbols being reduced, and their result. */
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
}
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
yy_reduce_print (Rule); \
} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
# define YYDSYMPRINT(Args)
# define YYDSYMPRINTF(Title, Token, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
/* YYINITDEPTH -- initial size of the parser's stacks. */
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
if the built-in stack extension method is used).
Do not make this value too large; the results are undefined if
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */
#if YYERROR_VERBOSE
# ifndef yystrlen
# if defined (__GLIBC__) && defined (_STRING_H)
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
static YYSIZE_T
# if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
# else
yystrlen (yystr)
const char *yystr;
# endif
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
while (*yys++ != '\0')
continue;
return yys - yystr - 1;
}
# endif
# endif
# ifndef yystpcpy
# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
static char *
# if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
# else
yystpcpy (yydest, yysrc)
char *yydest;
const char *yysrc;
# endif
{
register char *yyd = yydest;
register const char *yys = yysrc;
while ((*yyd++ = *yys++) != '\0')
continue;
return yyd - 1;
#if YYDEBUG
/*--------------------------------.
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
static void
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
#else
yysymprint (yyoutput, yytype, yyvaluep)
FILE *yyoutput;
int yytype;
YYSTYPE *yyvaluep;
#endif
/* Pacify ``unused variable'' warnings. */
(void) yyvaluep;
if (yytype < YYNTOKENS)
{
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
# ifdef YYPRINT
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# endif
}
else
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
switch (yytype)
{
default:
break;
}
YYFPRINTF (yyoutput, ")");
#endif /* ! YYDEBUG */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
static void
yydestruct (int yytype, YYSTYPE *yyvaluep)
#else
static void
yydestruct (yytype, yyvaluep)
int yytype;
YYSTYPE *yyvaluep;
{
/* Pacify ``unused variable'' warnings. */
(void) yyvaluep;
switch (yytype)
{
default:
break;
}
}

Christophe Geuzaine
committed
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM);
# else
int yyparse ();
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
#endif /* ! YYPARSE_PARAM */
/* The lookahead symbol. */
int yychar;
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
/* Number of syntax errors so far. */
int yynerrs;
/*----------.
| yyparse. |
`----------*/
#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM)
# else
int yyparse (YYPARSE_PARAM)
void *YYPARSE_PARAM;
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
int
yyparse (void)
#else
yyparse ()
#endif
#endif
{
register int yystate;
register int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
/* Lookahead token as an internal (translated) token number. */
int yytoken = 0;
/* Three stacks and their tools:
`yyss': related to states,
`yyvs': related to semantic values,
`yyls': related to locations.
Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
short yyssa[YYINITDEPTH];
short *yyss = yyssa;
register short *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
register YYSTYPE *yyvsp;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
/* When reducing, the number of symbols on the RHS of the reduced
rule. */
int yylen;
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyvsp = yyvs;
/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate. |
`------------------------------------------------------------*/
yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. so pushing a state here evens the stacks.
*/
yyssp++;
if (yyss + yystacksize - 1 <= yyssp)
{
/* Get the current used size of the three stacks, in elements. */
#ifdef yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
YYSTYPE *yyvs1 = yyvs;
short *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow ("parser stack overflow",
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
yyss = yyss1;
yyvs = yyvs1;
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
goto yyoverflowlab;
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyoverflowlab;
yystacksize *= 2;
yystacksize = YYMAXDEPTH;
{
short *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyoverflowlab;
YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
goto yybackup;
/*-----------.
| yybackup. |
`-----------*/
yybackup:
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
/* yyresume: */
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
yychar = YYLEX;
}
{
yychar = yytoken = YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
else
{
yytoken = YYTRANSLATE (yychar);
YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
}
/* If the proper action on seeing token YYTOKEN is to reduce or to
detect an error, take that action. */
yyn += yytoken;
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
goto yydefault;
yyn = yytable[yyn];
{
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
yystate = yyn;
goto yynewstate;
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
/*-----------------------------.
| yyreduce -- Do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
`$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
users should not rely upon it. Assigning to YYVAL
unconditionally makes the parser a bit smaller, and it avoids a
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
case 4:
{ yyerrok; return 1; ;}
break;
case 7:
{ return 1; ;}
break;
case 8:
{ return 1; ;}
break;
case 9:
{ return 1; ;}
break;
case 10:
yymsg(INFO, "Reading Step Iso-10303-21 data");
Create_Step_Solid_BRep();
Resolve_BREP ();
yymsg(INFO, "Read Step Iso-10303-21 data");
{
;}
break;
case 16:
{
;}
break;
case 17:
{
;}
break;
case 18:
Add_Cartesian_Point((int)yyvsp[-8].d, yyvsp[-4].c, yyvsp[-2].v[0], yyvsp[-2].v[1], yyvsp[-2].v[2]);
Add_BSpline_Curve_With_Knots ((int)yyvsp[-22].d, yyvsp[-18].c, (int) yyvsp[-16].d, yyvsp[-14].l, yyvsp[-6].l, yyvsp[-4].l, 0., 1.);
Add_BSpline_Surface_With_Knots ((int)yyvsp[-30].d, yyvsp[-26].c, (int) yyvsp[-24].d, (int) yyvsp[-22].d, yyvsp[-20].l, yyvsp[-10].l,
yyvsp[-8].l, yyvsp[-6].l, yyvsp[-4].l, 0., 1., 0., 1. );
Add_Edge_Curve ((int)yyvsp[-14].d, yyvsp[-10].c , (int)yyvsp[-8].d , (int)yyvsp[-6].d, (int)yyvsp[-4].d);
Add_Face_Outer_Bound((int)yyvsp[-10].d, yyvsp[-6].c, (int)yyvsp[-4].d, yyvsp[-2].i, 1);
// check the norm! Face_Bound : hole outside surface!
yymsg(INFO, "Found a face bound");
Add_Face_Outer_Bound((int)yyvsp[-10].d, yyvsp[-6].c, (int)yyvsp[-4].d, yyvsp[-2].i, 0);
Add_Oriented_Edge((int)yyvsp[-14].d, yyvsp[-10].c, (int)yyvsp[-4].d, yyvsp[-2].i);
Add_Advanced_Face((int)yyvsp[-12].d, yyvsp[-8].c, yyvsp[-6].l, (int)yyvsp[-4].d, yyvsp[-2].i);
Add_Vertex_Point((int)yyvsp[-8].d, yyvsp[-4].c, (int)yyvsp[-2].d);
{
;}
break;
case 29:
Add_Axis2_Placement3D ((int)yyvsp[-12].d, (int)yyvsp[-4].d, (int)yyvsp[-2].d, (int)yyvsp[-6].d);
Add_Direction((int)yyvsp[-8].d , yyvsp[-4].c, yyvsp[-2].v[0], yyvsp[-2].v[1], yyvsp[-2].v[2]);
Add_Line ((int)yyvsp[-10].d, yyvsp[-6].c , (int) yyvsp[-4].d, (int)yyvsp[-2].d);
yymsg(INFO, "Found a closed shell");
Add_Closed_Shell((int)yyvsp[-8].d, yyvsp[-4].c , yyvsp[-2].l);
{
;}
break;
case 35:
{
;}
break;
case 36:
Add_Cylinder ((int)yyvsp[-10].d, yyvsp[-6].c , (int)yyvsp[-4].d, yyvsp[-2].d);
Add_Cone ((int)yyvsp[-12].d, yyvsp[-8].c , (int)yyvsp[-6].d, yyvsp[-4].d, yyvsp[-2].d);
Add_Torus ((int)yyvsp[-12].d, yyvsp[-8].c , (int)yyvsp[-6].d, yyvsp[-4].d, yyvsp[-2].d);
Add_Circle((int) yyvsp[-10].d, yyvsp[-6].c, (int) yyvsp[-4].d, yyvsp[-2].d);
Add_Ellipse((int) yyvsp[-12].d, yyvsp[-8].c, (int) yyvsp[-6].d, yyvsp[-4].d, yyvsp[-2].d);
{
;}
break;
case 42:
{
;}
break;
case 43:
{
;}
break;
case 44:
{
;}
break;
case 45:
{
;}
break;
case 46:
{
;}
break;
case 47:
{
;}
break;
case 50:
{ return 1; ;}
break;
case 51:
{ return 1; ;}
break;
case 52:
{ return 1; ;}
break;
case 53:
{ return 1; ;}
break;
case 54:
{ List_Delete(yyvsp[0].l); return 1; ;}
break;
case 55:
{ List_Delete(yyvsp[0].l); return 1; ;}
break;
case 56:
{ return 1; ;}
break;
case 57:
{ return 1; ;}
break;
case 58:
{ return 1; ;}
break;
case 59:
{ List_Delete(yyvsp[0].l); return 1; ;}
break;
case 60:
{ return 1; ;}
break;
case 61:
{ return 1; ;}
break;
case 62:
{ return 1; ;}
break;
case 63:
{ return 1; ;}
break;
case 64:
char tmpstring[1024];
int i = PrintListOfDouble(yyvsp[-4].c, yyvsp[-2].l, tmpstring);
if(i < 0)
yymsg(GERROR, "Too few arguments in Printf");
else if(i > 0)
yymsg(GERROR, "%d extra argument%s in Printf", i, (i>1)?"s":"");
else
Msg(DIRECT, tmpstring);
Free(yyvsp[-4].c);
List_Delete(yyvsp[-2].l);
if(!strcmp(yyvsp[-5].c, "View") && !CheckViewErrorFlags(View)){
EndView(View, 0, yyname, yyvsp[-4].c);
}
Free(yyvsp[-5].c); Free(yyvsp[-4].c);
if(!strcmp(yyvsp[-7].c, "View") && !CheckViewErrorFlags(View)){
EndView(View, 0, yyname, yyvsp[-6].c);
}
Free(yyvsp[-7].c); Free(yyvsp[-6].c); Free(yyvsp[-5].c);
View = BeginView(1);
for(int i = 0; i < VIEW_NB_ELEMENT_TYPES; i++){
ViewErrorFlags[i] = 0;
}
{ ViewCoord[ViewCoordIdx] = yyvsp[0].d; ViewCoordIdx++; ;}
break;
case 75:
{ ViewCoord[ViewCoordIdx] = yyvsp[0].d; ViewCoordIdx++; ;}
break;
case 76:
{ if(ViewValueList) List_Add(ViewValueList, &yyvsp[0].d); ;}
break;
case 77:
{ if(ViewValueList) List_Add(ViewValueList, &yyvsp[0].d); ;}
break;
case 78:
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
if(!strcmp(yyvsp[0].c, "SP")){
ViewElementIdx = 0; ViewNumNodes = 1; ViewNumComp = 1;
ViewValueList = View->SP; ViewNumList = &View->NbSP;
}
else if(!strcmp(yyvsp[0].c, "VP")){
ViewElementIdx = 1; ViewNumNodes = 1; ViewNumComp = 3;
ViewValueList = View->VP; ViewNumList = &View->NbVP;
}
else if(!strcmp(yyvsp[0].c, "TP")){
ViewElementIdx = 2; ViewNumNodes = 1; ViewNumComp = 9;
ViewValueList = View->TP; ViewNumList = &View->NbTP;
}
else if(!strcmp(yyvsp[0].c, "SL")){
ViewElementIdx = 3; ViewNumNodes = 2; ViewNumComp = 1;
ViewValueList = View->SL; ViewNumList = &View->NbSL;
}
else if(!strcmp(yyvsp[0].c, "VL")){
ViewElementIdx = 4; ViewNumNodes = 2; ViewNumComp = 3;
ViewValueList = View->VL; ViewNumList = &View->NbVL;
}
else if(!strcmp(yyvsp[0].c, "TL")){
ViewElementIdx = 5; ViewNumNodes = 2; ViewNumComp = 9;
ViewValueList = View->TL; ViewNumList = &View->NbTL;
}
else if(!strcmp(yyvsp[0].c, "ST")){
ViewElementIdx = 6; ViewNumNodes = 3; ViewNumComp = 1;
ViewValueList = View->ST; ViewNumList = &View->NbST;
}
else if(!strcmp(yyvsp[0].c, "VT")){
ViewElementIdx = 7; ViewNumNodes = 3; ViewNumComp = 3;
ViewValueList = View->VT; ViewNumList = &View->NbVT;
}
else if(!strcmp(yyvsp[0].c, "TT")){
ViewElementIdx = 8; ViewNumNodes = 3; ViewNumComp = 9;
ViewValueList = View->TT; ViewNumList = &View->NbTT;
}
else if(!strcmp(yyvsp[0].c, "SQ")){
ViewElementIdx = 9; ViewNumNodes = 4; ViewNumComp = 1;
ViewValueList = View->SQ; ViewNumList = &View->NbSQ;
}
else if(!strcmp(yyvsp[0].c, "VQ")){
ViewElementIdx = 10; ViewNumNodes = 4; ViewNumComp = 3;
ViewValueList = View->VQ; ViewNumList = &View->NbVQ;
}
else if(!strcmp(yyvsp[0].c, "TQ")){
ViewElementIdx = 11; ViewNumNodes = 4; ViewNumComp = 9;
ViewValueList = View->TQ; ViewNumList = &View->NbTQ;
}
else if(!strcmp(yyvsp[0].c, "SS")){
ViewElementIdx = 12; ViewNumNodes = 4; ViewNumComp = 1;
ViewValueList = View->SS; ViewNumList = &View->NbSS;
}
else if(!strcmp(yyvsp[0].c, "VS")){
ViewElementIdx = 13; ViewNumNodes = 4; ViewNumComp = 3;
ViewValueList = View->VS; ViewNumList = &View->NbVS;
}
else if(!strcmp(yyvsp[0].c, "TS")){
ViewElementIdx = 14; ViewNumNodes = 4; ViewNumComp = 9;
ViewValueList = View->TS; ViewNumList = &View->NbTS;
}
else if(!strcmp(yyvsp[0].c, "SH")){
ViewElementIdx = 15; ViewNumNodes = 8; ViewNumComp = 1;
ViewValueList = View->SH; ViewNumList = &View->NbSH;
}
else if(!strcmp(yyvsp[0].c, "VH")){
ViewElementIdx = 16; ViewNumNodes = 8; ViewNumComp = 3;
ViewValueList = View->VH; ViewNumList = &View->NbVH;