EnglishРусский  

   ..

   alias.c

   alias.h

   bcodes.c

   bcodes.h

   body.c

   compile.c

   compile.h

   define.c

   define.h

   desc.c

   expr.c

   extern.c

   for.c

   foreach.c

   func.c

   func.h

   global.c

   global.h

   goto.c

   if.c

   ifdef.c

   ifdef.h

   import.c

   import.h

   include.c

   include.h

   jump.c

   lexem.c

   lexem.h

   macro.c

   macro.h

   operlist.txt

   out.c

   out.h

   subfunc.c

   switch.c

   type.c

   type.h

   vars.c

   while.c

   with.c

Ads

Perfect Automation tool
All-In-One: Script editor, Launcher, Scheduler, Keyboard & Mouse Recorder. Try now!

CreateInstall
Freeware and commercial installers.

Cell Phone Batteries
Batteries Plus offers batteries for laptop, camcorder, cell phone, camera.

Gentee needs your help!
How to advertise with us
 
laptop battery

 1 /******************************************************************************
 2 *
 3 * Copyright (C) 2006, The Gentee Group. All rights reserved.
 4 * This file is part of the Gentee open source project - http://www.gentee.com.
 5 *
 6 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE GENTEE LICENSE ("AGREEMENT").
 7 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES RECIPIENTS
 8 * ACCEPTANCE OF THE AGREEMENT.
 9 *
10 * ID: goto 08.02.07 0.0.A.
11 *
12 * Author: Alexander Krivonogov ( algen )
13 *
14 * Summary: Конструкции goto, label
15 *
16 ******************************************************************************/
17 
18 #include "func.h"
19 
20 /*-----------------------------------------------------------------------------
21 *
22 * ID: c_goto 08.02.07 0.0.A.
23 *
24 * Summary: The goto processing
25 *
26 -----------------------------------------------------------------------------*/
27 plexem STDCALL c_goto( plexem curlex )
28 {
29    pflabel    curlabel; //Текущий элемент в стэке меток
30    phashiuint phitem;   //Элемент хэштаблицы со смещением описания метки
31    uint       offlabel; //Смещение в таблице меток
32 
33    out_debugtrace( curlex );
34 
35    if ( curlex->type == LEXEM_NAME )
36    {
37       out_add2uint( CGoto, 0 );
38       phitem = (phashiuint)hash_create( &fd.nlabels, lexem_getname( curlex ) );
39       //curlabel = newlabel;
40       curlabel = (pflabel)buf_appendtype( &fd.blabels, sizeof( flabel ));
41 
42       curlabel->offbout = fd.bout->use - sizeof( uint );
43       offlabel = phitem->val;
44       if ( !offlabel || offlabel == -1)
45       {  //Такого имени ещё нет
46          curlabel->type = LABT_GTUNDEF;
47          curlabel->hitem = phitem;//?phitem вроде постоянный
48          curlabel->lex = curlex;
49          phitem->val = -1;
50       }
51       else
52       {
53          if ( (( pflabel )( fd.blabels.data + offlabel ))->type ==
54                ( LABT_LABEL | (uint)( fd.bout == &fd.bsubout ? LABT_SUBFUNC : 0) ) )
55          {  //Действующая метка
56             curlabel->type = LABT_GTDEF;
57             curlabel->link = offlabel;
58          }
59          else
60             msg( MUnklabel | MSG_LEXNAMEERR, curlabel->lex );
61       }
62    }
63    else
64       msg( MExpname | MSG_LEXERR, curlex );
65    curlex = lexem_next( curlex, 0 );
66    
67    return curlex;
68 }
69 
70 
71 /*-----------------------------------------------------------------------------
72 *
73 * ID: c_label 08.02.07 0.0.A.
74 *
75 * Summary: The label processing
76 *
77 -----------------------------------------------------------------------------*/
78 plexem STDCALL c_label( plexem curlex )
79 {
80    uint       offlabel; //Смещение в таблице меток
81    phashiuint phitem;   //Элемент хэштаблицы со смещением описания метки
82 
83    if ( curlex->type == LEXEM_NAME )//Идентификатор
84    {      
85       phitem = (phashiuint)hash_create( &fd.nlabels, lexem_getname( curlex ) );
86       if ( !phitem->val || phitem->val == -1 )
87       {  //Такого имени ещё нет
88          offlabel = j_label( LABT_LABEL |
89                               (fd.bout == &fd.bsubout ? LABT_SUBFUNC : 0), (uint)phitem );
90          phitem->val = offlabel;
91       }
92       else
93          msg( MRedeflabel | MSG_LEXNAMEERR, curlex );
94    }
95    else
96       msg( MExpname | MSG_LEXERR, curlex );
97    return lexem_next( curlex, 0 );
98 }
Edit