1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: header.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 #pragma GCC system_header
34 #elif defined __SUNPRO_CC
59 RscDefine
* defineele
;
61 RscExpType macrostruct
;
66 %token
<string> SYMBOL
67 %token
<defineele
> RSCDEFINE
68 %token
<string> STRING
69 %token
<string> INCLUDE_STRING
70 %token
<character
> CHARACTER
71 %token
<svbool
> BOOLEAN
82 %token INZOOMOUTPUTSIZE
90 %token
<pClass
> CLASSNAME
91 %token
<varid
> VARNAME
92 %token
<constname
> CONSTNAME
98 %type
<macrostruct
> macro_expression
99 %type
<macrostruct
> id_expression
100 %type
<value
> long_expression
101 %type
<string> string_multiline
104 %type
<pClass
> type_base
105 %type
<header
> class_header_body
106 %type
<header
> class_header
107 %type
<header
> var_header_class
108 %type
<copyref
> copy_ref
109 %type
<ushort
> type_flags
114 %left LEFTSHIFT RIGHTSHIFT
125 %start resource_definitions
129 /********************** D E F I N I T I O N S ****************************/
132 | resource_definitions resource_definition
133 | MACROTARGET macro_expression
138 aExpType.cType
= RSCEXP_NOTHING
;
139 pExp
= new RscExpression
( aExpType
, '+', $2 );
140 if
( !pExp
->Evaluate
( &lValue
) )
141 pTC
->pEH
->Error
( ERR_ZERODIVISION
, NULL
, RscId
() );
147 |
'#' DEFINE SYMBOL macro_expression
152 if
( !pTC
->aFileTab.NewDef
( pFI
->GetFileIndex
(),
154 $4.GetLong
(), LIST_APPEND
) )
157 else if
( $4.IsDefinition
() ){
159 RscExpression
* pExpr
;
161 aExpType.cType
= RSCEXP_NOTHING
;
162 aExpType.SetLong
( 0 );
163 aExpType.cType
= RSCEXP_LONG
;
164 pExpr
= new RscExpression
( aExpType
, '+', $4 );
166 if
( !pTC
->aFileTab.NewDef
( pFI
->GetFileIndex
(),
167 ByteString
( $3 ), pExpr
, LIST_APPEND
) )
170 else if
( $4.IsExpression
() ){
171 if
( !pTC
->aFileTab.NewDef
( pFI
->GetFileIndex
(),
172 ByteString
( $3 ), $4.aExp.pExp
,
178 pTC
->pEH
->Error
( ERR_DECLAREDEFINE
, NULL
, RscId
(), $3 );
181 |
'#' DEFINE RSCDEFINE macro_expression
183 pTC
->pEH
->Error
( ERR_DOUBLEDEFINE
, NULL
, RscId
(), $3->GetName
().GetBuffer
() );
188 |
'#' INCLUDE INCLUDE_STRING
191 | class_definition
';'
195 pMem
= rtl_allocateMemory
( 20000 );
196 rtl_freeMemory
( pMem
);
199 | new_class_definition_header
'{' new_class_definition_body
'}' ';'
200 | new_class_definition_header
';'
203 new_class_definition_header
204 : CLASS SYMBOL id_expression
':' CLASSNAME
208 $3.Evaluate
( &lType
);
211 Atom nId
= pHS
->getID
( $2 );
212 pCurClass
= new RscClass
( nId
, lType
, $5 );
214 pTC
->aNmTb.Put
( nId
, CLASSNAME
, pCurClass
);
215 pTC
->GetRoot
()->Insert
( pCurClass
);
217 | CLASS CLASSNAME id_expression
':' CLASSNAME
224 new_class_definition_body
226 | property_definition
';' new_class_definition_body
230 : type_flags type SYMBOL
233 Atom nId
= pTC
->aNmTb.Put
( $3, VARNAME
);
234 pCurClass
->SetVariable
( nId
, $2, NULL
, $1, nCurMask
);
237 | type_flags type VARNAME
239 pCurClass
->SetVariable
( $3, $2, NULL
, $1, nCurMask
);
245 : type_flags EXTENDABLE
247 $$
= $1 | VAR_EXTENDABLE
;
249 | type_flags WRITEIFSET
251 $$
= $1 | VAR_SVDYNAMIC
;
268 ByteString aTypeName
= pHS
->getString
( $1->GetId
() );
270 $$
= pTC
->SearchType
( pHS
->getID
( aTypeName.GetBuffer
(), true
) );
274 pCont
= new RscCont
( pHS
->getID
( aTypeName.GetBuffer
() ), RSC_NOTYPE
);
275 pCont
->SetTypeClass
( $1 );
276 pTC
->InsertType
( pCont
);
292 RscTop
* pType
= pTC
->SearchType
( pHS
->getID
( $1, true
) );
294 pTC
->pEH
->Error
( ERR_NOTYPE
, pCurClass
, RscId
() );
300 : class_header class_body
302 if
( TYPE_REF
== $1.nTyp
)
303 pTC
->pEH
->Error
( ERR_REFNOTALLOWED
, S.Top
().pClass
,
304 RscId
( $1.nName1
) );
310 RscId aRscId
( $1.nName1
);
312 if
( TYPE_NOTHING
== $1.nTyp
&& aRscId.IsId
() )
313 aError
= S.Top
().pClass
->SetRef
( S.Top
(), aRscId
);
314 else if
( TYPE_COPY
== $1.nTyp
)
315 aError
= ERR_COPYNOTALLOWED
;
316 if
( aError.IsError
() || aError.IsWarning
() )
317 pTC
->pEH
->Error
( aError
, S.Top
().pClass
, aRscId
);
325 if
( !DoClassHeader
( &$1, FALSE
) )
343 : CLASSNAME id_expression copy_ref CLASSNAME id_expression
351 | CLASSNAME id_expression copy_ref id_expression
359 | CLASSNAME id_expression
363 $$.nTyp
= TYPE_NOTHING
;
365 $$.nName2.cType
= RSCEXP_NOTHING
;
367 | CLASSNAME copy_ref id_expression
370 $$.nName1.cType
= RSCEXP_NOTHING
;
375 | CLASSNAME copy_ref CLASSNAME id_expression
378 $$.nName1.cType
= RSCEXP_NOTHING
;
386 $$.nName1.cType
= RSCEXP_NOTHING
;
387 $$.nTyp
= TYPE_NOTHING
;
388 $$.nName2.cType
= RSCEXP_NOTHING
;
393 : '{' var_definitions
'}'
397 SetString
( S.Top
(), "TEXT", $1 );
403 | var_definitions var_definition
409 SetConst
( S.Top
(), "_XYMAPMODE", $1.hashid
, $1.nValue
);
417 SetConst
( S.Top
(), "_WHMAPMODE", $1.hashid
, $1.nValue
);
425 SetConst
( S.Top
(), "_XYMAPMODE", $1.hashid
, $1.nValue
);
426 SetConst
( S.Top
(), "_WHMAPMODE", $1.hashid
, $1.nValue
);
433 | var_header var_body
';'
437 | class_definition
';'
438 | var_header_class class_body
';'
440 if
( TYPE_REF
== $1.nTyp
)
441 pTC
->pEH
->Error
( ERR_REFNOTALLOWED
, S.Top
().pClass
,
442 RscId
( $1.nName1
) );
444 if
( S.Top
().pClass
->GetCount
( S.Top
() ) )
445 pTC
->pEH
->Error
( WRN_SUBINMEMBER
, S.Top
().pClass
,
446 RscId
( $1.nName1
) );
450 | var_header_class
';'
453 RscId aRscId
( $1.nName1
);
455 if
( TYPE_NOTHING
== $1.nTyp
&& aRscId.IsId
() )
456 aError
= S.Top
().pClass
->SetRef
( S.Top
(), aRscId
);
457 else if
( TYPE_COPY
== $1.nTyp
)
458 aError
= ERR_COPYNOTALLOWED
;
459 if
( S.Top
().pClass
->GetCount
( S.Top
() ) )
460 aError
= WRN_SUBINMEMBER
;
461 if
( aError.IsError
() || aError.IsWarning
() )
462 pTC
->pEH
->Error
( aError
, S.Top
().pClass
, aRscId
);
466 | XSCALE
'=' '(' long_expression
',' long_expression
')' ';'
468 SetNumber
( S.Top
(), "_XNUMERATOR", $4 );
469 SetNumber
( S.Top
(), "_XDENOMINATOR", $6 );
471 | YSCALE
'=' '(' long_expression
',' long_expression
')' ';'
473 SetNumber
( S.Top
(), "_YNUMERATOR", $4 );
474 SetNumber
( S.Top
(), "_YDENOMINATOR", $6 );
476 | RGB
'=' '(' long_expression
',' long_expression
477 ',' long_expression
')' ';'
479 SetNumber
( S.Top
(), "RED", $4 );
480 SetNumber
( S.Top
(), "GREEN", $6 );
481 SetNumber
( S.Top
(), "BLUE", $8 );
483 | GEOMETRY
'=' xywh_mapmode
'(' long_expression
',' long_expression
','
484 long_expression
',' long_expression
')' ';'
486 SetNumber
( S.Top
(), "_X", $5 );
487 SetNumber
( S.Top
(), "_Y", $7 );
488 SetNumber
( S.Top
(), "_WIDTH", $9 );
489 SetNumber
( S.Top
(), "_HEIGHT", $11 );
491 | POSITION
'=' xy_mapmode
'(' long_expression
',' long_expression
494 SetNumber
( S.Top
(), "_X", $5 );
495 SetNumber
( S.Top
(), "_Y", $7 );
497 | DIMENSION
'=' wh_mapmode
'(' long_expression
',' long_expression
500 SetNumber
( S.Top
(), "_WIDTH", $5 );
501 SetNumber
( S.Top
(), "_HEIGHT", $7 );
503 | INZOOMOUTPUTSIZE
'=' CONSTNAME
'(' long_expression
',' long_expression
506 SetConst
( S.Top
(), "_ZOOMINMAPMODE", $3.hashid
, $3.nValue
);
507 SetNumber
( S.Top
(), "_ZOOMINWIDTH", $5 );
508 SetNumber
( S.Top
(), "_ZOOMINHEIGHT", $7 );
510 | INZOOMOUTPUTSIZE
'=' '(' long_expression
',' long_expression
')' ';'
512 SetNumber
( S.Top
(), "_ZOOMINWIDTH", $4 );
513 SetNumber
( S.Top
(), "_ZOOMINHEIGHT", $6 );
515 | FLOATINGPOS
'=' CONSTNAME
'(' long_expression
',' long_expression
518 SetConst
( S.Top
(), "_FLOATINGPOSMAPMODE", $3.hashid
, $3.nValue
);
519 SetNumber
( S.Top
(), "_FLOATINGPOSX", $5 );
520 SetNumber
( S.Top
(), "_FLOATINGPOSY", $7 );
522 | FLOATINGPOS
'=' '(' long_expression
',' long_expression
')' ';'
524 SetNumber
( S.Top
(), "_FLOATINGPOSX", $4 );
525 SetNumber
( S.Top
(), "_FLOATINGPOSY", $6 );
530 : VARNAME
'=' class_header_body
534 aInst
= S.Top
().pClass
->GetVariable
( S.Top
(), $1, RSCINST
(), FALSE
, $3.pClass
);
540 pTC
->pEH
->Error
( ERR_NOVARIABLENAME
, S.Top
().pClass
, RscId
(),
541 pHS
->getString
( $1 ) );
545 if
( !DoClassHeader
( &$3, TRUE
) )
549 | VARNAME
'[' CONSTNAME
']' '=' class_header_body
553 aInst
= S.Top
().pClass
->GetVariable
( S.Top
(), $1, RSCINST
() );
560 aError
= aInst.pClass
->GetArrayEle
( aInst
, $3.hashid
, NULL
, &aIdxInst
);
561 if
( aError.IsError
() || aError.IsWarning
() )
562 pTC
->pEH
->Error
( aError
, S.Top
().pClass
, RscId
() );
563 if
( aError.IsError
() )
569 pTC
->pEH
->Error
( ERR_NOVARIABLENAME
, S.Top
().pClass
, RscId
(),
570 pHS
->getString
( $1 ) );
573 if
( !DoClassHeader
( &$6, TRUE
) )
577 | VARNAME
'[' SYMBOL
']' '=' class_header_body
581 aInst
= S.Top
().pClass
->GetVariable
( S.Top
(), $1, RSCINST
() );
585 long nNewLang
= pTC
->AddLanguage
( $3 );
589 aError
= aInst.pClass
->GetArrayEle
( aInst
, nNewLang
, NULL
, &aIdxInst
);
590 if
( aError.IsError
() || aError.IsWarning
() )
591 pTC
->pEH
->Error
( aError
, S.Top
().pClass
, RscId
() );
592 if
( aError.IsError
() )
598 pTC
->pEH
->Error
( ERR_NOVARIABLENAME
, S.Top
().pClass
, RscId
(),
599 pHS
->getString
( $1 ) );
602 if
( !DoClassHeader
( &$6, TRUE
) )
613 aInst
= S.Top
().pClass
->GetVariable
( S.Top
(), $1, RSCINST
() );
618 pTC
->pEH
->Error
( ERR_NOVARIABLENAME
, S.Top
().pClass
, RscId
(),
619 pHS
->getString
( $1 ) );
623 | VARNAME
'[' CONSTNAME
']' '='
627 aInst
= S.Top
().pClass
->GetVariable
( S.Top
(), $1, RSCINST
() );
634 aError
= aInst.pClass
->GetArrayEle
( aInst
, $3.hashid
, NULL
, &aIdxInst
);
635 if
( aError.IsError
() || aError.IsWarning
() )
636 pTC
->pEH
->Error
( aError
, S.Top
().pClass
, RscId
() );
637 if
( aError.IsError
() )
642 pTC
->pEH
->Error
( ERR_NOVARIABLENAME
, S.Top
().pClass
, RscId
(),
643 pHS
->getString
( $1 ) );
647 | VARNAME
'[' SYMBOL
']' '='
651 aInst
= S.Top
().pClass
->GetVariable
( S.Top
(), $1, RSCINST
() );
655 long nNewLang
= pTC
->AddLanguage
( $3 );
659 aError
= aInst.pClass
->GetArrayEle
( aInst
, nNewLang
, NULL
, &aIdxInst
);
660 if
( aError.IsError
() || aError.IsWarning
() )
661 pTC
->pEH
->Error
( aError
, S.Top
().pClass
, RscId
() );
662 if
( aError.IsError
() )
667 pTC
->pEH
->Error
( ERR_NOVARIABLENAME
, S.Top
().pClass
, RscId
(),
668 pHS
->getString
( $1 ) );
678 aInst
= S.Top
().pClass
->GetTupelVar
( S.Top
(), 0, RSCINST
() );
683 pTC
->pEH
->Error
( ERR_NOTUPELNAME
, S.Top
().pClass
, RscId
() );
694 aInst
= S.Top
().pClass
->GetTupelVar
( S.Top
(), 1, RSCINST
() );
699 pTC
->pEH
->Error
( ERR_NOTUPELNAME
, S.Top
().pClass
, RscId
() );
710 aInst
= S.Top
().pClass
->GetTupelVar
( S.Top
(), 2, RSCINST
() );
715 pTC
->pEH
->Error
( ERR_NOTUPELNAME
, S.Top
().pClass
, RscId
() );
726 aInst
= S.Top
().pClass
->GetTupelVar
( S.Top
(), 3, RSCINST
() );
729 pTC
->pEH
->Error
( ERR_NOTUPELNAME
, S.Top
().pClass
, RscId
() );
749 aError
= S.Top
().pClass
->GetElement
( S.Top
(), RscId
(),
750 NULL
, RSCINST
(), &aInst
);
751 if
( aError.IsError
() || aError.IsWarning
() )
752 pTC
->pEH
->Error
( aError
, S.Top
().pClass
, RscId
() );
753 if
( aError.IsError
() )
754 { // unbedingt Instanz auf den Stack bringen
755 aInst
= S.Top
().pClass
->Create
( NULL
, RSCINST
() );
771 sal_uInt32 nCount
= S.Top
().pClass
->GetCount
( S.Top
() );
774 for
( i
= nCount
; i
> 0; i
-- )
775 S.Top
().pClass
->DeletePos
( S.Top
(), i
-1 );
780 : list var_list_header list_body
';'
781 | list var_bodysimple
';'
782 | list class_definition
';'
793 if
( !$1.Evaluate
( &l
) )
794 pTC
->pEH
->Error
( ERR_ZERODIVISION
, NULL
, RscId
() );
797 aError
= S.Top
().pClass
->SetRef
( S.Top
(), RscId
( $1 ) );
798 if
( aError.IsError
() )
801 aError
= S.Top
().pClass
->SetNumber
( S.Top
(), l
);
803 if
( aError.IsError
() )
804 { // Aufwaertskompatible, Tupel probieren
805 RSCINST aInst
= GetFirstTupelEle
( S.Top
() );
808 aError.Clear
(); // Fehler zuruecksetzen
809 aError
= aInst.pClass
->SetRef
( aInst
, RscId
( $1 ) );
810 if
( aError.IsError
() )
813 aError
= aInst.pClass
->SetNumber
( aInst
, l
);
819 if
( $1.IsExpression
() )
822 if
( aError.IsError
() || aError.IsWarning
() )
823 pTC
->pEH
->Error
( aError
, S.Top
().pClass
, RscId
() );
828 aError
= S.Top
().pClass
->SetConst
( S.Top
(), $1.hashid
, $1.nValue
);
829 if
( aError.IsError
() )
830 { // Aufwaertskompatible, Tupel probieren
831 RSCINST aInst
= GetFirstTupelEle
( S.Top
() );
834 aError.Clear
(); // Fehler zuruecksetzen
835 aError
= aInst.pClass
->SetConst
( aInst
, $1.hashid
, $1.nValue
);
839 if
( aError.IsError
() || aError.IsWarning
() )
840 pTC
->pEH
->Error
( aError
, S.Top
().pClass
, RscId
() );
845 aError
= S.Top
().pClass
->SetNotConst
( S.Top
(), $2.hashid
);
846 if
( aError.IsError
() )
847 { // Aufwaertskompatible, Tupel probieren
848 RSCINST aInst
= GetFirstTupelEle
( S.Top
() );
851 aError.Clear
(); // Fehler zuruecksetzen
852 aError
= aInst.pClass
->SetNotConst
( aInst
, $2.hashid
);
856 if
( aError.IsError
() || aError.IsWarning
() )
857 pTC
->pEH
->Error
( aError
, S.Top
().pClass
, RscId
() );
862 aError
= S.Top
().pClass
->SetBool
( S.Top
(), $1 );
863 if
( aError.IsError
() )
864 { // Aufwaertskompatible, Tupel probieren
865 RSCINST aInst
= GetFirstTupelEle
( S.Top
() );
868 aError.Clear
(); // Fehler zuruecksetzen
869 aError
= aInst.pClass
->SetBool
( aInst
, $1 );
873 if
( aError.IsError
() || aError.IsWarning
() )
874 pTC
->pEH
->Error
( aError
, S.Top
().pClass
, RscId
() );
879 aError
= S.Top
().pClass
->SetString
( S.Top
(), $1 );
880 if
( aError.IsError
() )
881 { // Aufwaertskompatible, Tupel probieren
882 RSCINST aInst
= GetFirstTupelEle
( S.Top
() );
885 aError.Clear
(); // Fehler zuruecksetzen
886 aError
= aInst.pClass
->SetString
( aInst
, $1 );
890 if
( aError.IsError
() || aError.IsWarning
() )
891 pTC
->pEH
->Error
( aError
, S.Top
().pClass
, RscId
() );
897 : '{' list_header list
'}'
898 |
'<' tupel_header0 tupel_body
';' '>'
899 |
'<' tupel_header0 tupel_body
';' tupel_header1 tupel_body
';' '>'
900 |
'<' tupel_header0 tupel_body
';' tupel_header1 tupel_body
';'
901 tupel_header2 tupel_body
';' '>'
902 |
'<' tupel_header0 tupel_body
';' tupel_header1 tupel_body
';'
903 tupel_header2 tupel_body
';' tupel_header3 tupel_body
';' '>'
911 /********************** work on yacc stack *******************************/
917 | string_multiline STRING
919 rtl
::OStringBuffer aBuf
( 256 );
922 $$
= (char*)pStringContainer
->putString
( aBuf.getStr
() );
929 if
( !$1.Evaluate
( &$$
) )
930 pTC
->pEH
->Error
( ERR_ZERODIVISION
, NULL
, RscId
() );
931 if
( $1.IsExpression
() )
939 $$.cType
= RSCEXP_DEF
;
944 $$.cType
= RSCEXP_LONG
;
947 |
'-' macro_expression %prec UNARYMINUS
951 $$.SetLong
( - $2.GetLong
() );
956 aLeftExp.cType
= RSCEXP_NOTHING
;
957 $$.cType
= RSCEXP_EXP
;
958 $$.aExp.pExp
= new RscExpression
( aLeftExp
, '-', $2 );
961 |
'+' macro_expression %prec UNARYPLUS
965 | macro_expression
'+' macro_expression
967 if
( $1.IsNumber
() && $3.IsNumber
() ){
968 $$.cType
= RSCEXP_LONG
;
969 $$.SetLong
( $1.GetLong
() + $3.GetLong
() );
972 $$.cType
= RSCEXP_EXP
;
973 $$.aExp.pExp
= new RscExpression
( $1, '+', $3 );
976 | macro_expression
'-' macro_expression
978 if
( $1.IsNumber
() && $3.IsNumber
() ){
979 $$.cType
= RSCEXP_LONG
;
980 $$.SetLong
( $1.GetLong
() - $3.GetLong
() );
983 $$.cType
= RSCEXP_EXP
;
984 $$.aExp.pExp
= new RscExpression
( $1, '-', $3 );
987 | macro_expression
'*' macro_expression
989 if
( $1.IsNumber
() && $3.IsNumber
() ){
990 $$.cType
= RSCEXP_LONG
;
991 $$.SetLong
( $1.GetLong
() * $3.GetLong
() );
994 $$.cType
= RSCEXP_EXP
;
995 $$.aExp.pExp
= new RscExpression
( $1, '*', $3 );
998 | macro_expression
'/' macro_expression
1000 if
( $1.IsNumber
() && $3.IsNumber
() ){
1001 if
( 0 == $3.GetLong
() ){
1002 $$.cType
= RSCEXP_EXP
;
1003 $$.aExp.pExp
= new RscExpression
( $1, '/', $3 );
1006 $$.cType
= RSCEXP_LONG
;
1007 $$.SetLong
( $1.GetLong
() / $3.GetLong
() );
1011 $$.cType
= RSCEXP_EXP
;
1012 $$.aExp.pExp
= new RscExpression
( $1, '/', $3 );
1015 | macro_expression
'&' macro_expression
1017 if
( $1.IsNumber
() && $3.IsNumber
() ){
1018 $$.cType
= RSCEXP_LONG
;
1019 $$.SetLong
( $1.GetLong
() & $3.GetLong
() );
1022 $$.cType
= RSCEXP_EXP
;
1023 $$.aExp.pExp
= new RscExpression
( $1, '&', $3 );
1026 | macro_expression
'|' macro_expression
1028 if
( $1.IsNumber
() && $3.IsNumber
() ){
1029 $$.cType
= RSCEXP_LONG
;
1030 $$.SetLong
( $1.GetLong
() |
$3.GetLong
() );
1033 $$.cType
= RSCEXP_EXP
;
1034 $$.aExp.pExp
= new RscExpression
( $1, '|', $3 );
1037 |
'(' macro_expression
')'
1041 | macro_expression LEFTSHIFT macro_expression
1043 if
( $1.IsNumber
() && $3.IsNumber
() ){
1044 $$.cType
= RSCEXP_LONG
;
1045 $$.SetLong
( $1.GetLong
() << $3.GetLong
() );
1048 $$.cType
= RSCEXP_EXP
;
1049 $$.aExp.pExp
= new RscExpression
( $1, 'l', $3 );
1052 | macro_expression RIGHTSHIFT macro_expression
1054 if
( $1.IsNumber
() && $3.IsNumber
() ){
1055 $$.cType
= RSCEXP_LONG
;
1056 $$.SetLong
( $1.GetLong
() >> $3.GetLong
() );
1059 $$.cType
= RSCEXP_EXP
;
1060 $$.aExp.pExp
= new RscExpression
( $1, 'r', $3 );
1066 : id_expression line_number
1068 { // pExpession auswerten und loeschen
1069 if
( RSCEXP_EXP
== $1.cType
){
1072 if
( !$1.Evaluate
( &lValue
) )
1073 pTC
->pEH
->Error
( ERR_ZERODIVISION
, NULL
, RscId
() );
1074 delete
$1.aExp.pExp
;
1075 $$.cType
= RSCEXP_LONG
;
1076 $$.SetLong
( lValue
);
1093 : '#' LINE NUMBER STRING
1097 pFI
->SetLineNo
( $3 );
1098 pFI
->SetFileIndex
( pTC
->aFileTab.NewCodeFile
( ByteString
( $4 ) ) );
1099 pFName
= pTC
->aFileTab.Get
( pFI
->GetFileIndex
() );
1100 pFName
->bLoaded
= TRUE
;
1101 pFName
->bScanned
= TRUE
;
1103 |
'#' NUMBER STRING DUMMY_NUMBER
1107 pFI
->SetLineNo
( $2 );
1108 pFI
->SetFileIndex
( pTC
->aFileTab.NewCodeFile
( ByteString
( $3 ) ) );
1109 pFName
= pTC
->aFileTab.Get
( pFI
->GetFileIndex
() );
1110 pFName
->bLoaded
= TRUE
;
1111 pFName
->bScanned
= TRUE
;
1115 pFI
->SetLineNo
( $2 );