Ignore:
Timestamp:
Apr 5, 2019, 9:26:53 PM (5 years ago)
Author:
coas-nagasima
Message:

mbed関連を更新
シリアルドライバをmbedのHALを使うよう変更
ファイルディスクリプタの処理を更新

Location:
asp3_tinet_ecnl_rx/trunk/asp3_dcre
Files:
104 added
1 deleted
91 edited
2 moved

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/Debug/Makefile

    r364 r374  
    153153
    154154#
     155#  mbedサービスの定義
     156#
     157
     158include $(SRCDIR)/mbed/Makefile.mbed
     159
     160#
    155161#  共通コンパイルオプションの定義
    156162#
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/DebugCitrus/Makefile

    r364 r374  
    153153
    154154#
     155#  mbedサービスの定義
     156#
     157
     158include $(SRCDIR)/mbed/Makefile.mbed
     159
     160#
    155161#  共通コンパイルオプションの定義
    156162#
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/arch/rx630_gcc/tSCIF.c

    r337 r374  
    4747#include "tSCIF_tecsgen.h"
    4848#include "scif.h"
     49#include "target_kernel_impl.h"
    4950
    5051/*
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/cfg/pass1.rb

    r337 r374  
    727727  #
    728728  def self.OutLineNumber(cfgInfo)
    729     @cfg1Out.add("#line #{cfgInfo[:_LINE_]} \"#{cfgInfo[:_FILE_]}\"")
     729    @cfg1Out.add("#line #{cfgInfo[:_LINE_]} \"#{cfgInfo[:_FILE_].gsub('\\', '/')}\"")
    730730  end
    731731
     
    734734  #
    735735  def self.OutClassLineNumber(cfgInfo)
    736     @cfg1Out.add("#line #{cfgInfo[:CLASS_LINE_]} \"#{cfgInfo[:CLASS_FILE_]}\"")
     736    @cfg1Out.add("#line #{cfgInfo[:CLASS_LINE_]} \"#{cfgInfo[:CLASS_FILE_].gsub('\\', '/')}\"")
    737737  end
    738738
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/gdic/adafruit_ssd1306/adafruit_ssd1306.h

    r364 r374  
    2222#include <stdbool.h>
    2323#include <time.h>
    24 #include "mbed_api.h"
     24#include "gpio_api.h"
     25#include "spi_api.h"
     26#include "i2c_api.h"
    2527#include "gfxfont.h"
    2628
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/Makefile.target

    r337 r374  
    1313#  コンパイルオプション
    1414#
    15 INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/pdic
     15INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/mbed
    1616
    1717#
     
    2525#  システムサービスに関する定義
    2626#
    27 SYSSVC_DIRS := $(SYSSVC_DIRS)
     27SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/mbed
    2828SYSSVC_COBJS := $(SYSSVC_COBJS)
    2929
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/gr_citrus.h

    r337 r374  
    7171 *  ボーレート設定
    7272 */
    73 #define BAUD_19200BPS           UINT_C( 78 )
    74 #define BAUD_38400BPS           UINT_C( 39 )
    75 #define BAUD_57600BPS           UINT_C( 25 )
    76 #define BAUD_115200BPS          UINT_C( 12 )
    77 
    78 #define UART_BAUDRATE           BAUD_115200BPS
     73#define UART_BAUDRATE           115200
    7974
    8075/*
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/tSIOPortGRCitrus.cdl

    r337 r374  
    5151 */
    5252import_C("gr_citrus.h");
    53 import_C("rx630.h");
     53import_C("device.h");
    5454
    5555/*
    5656 *  FIFO内蔵シリアルコミュニケーションインタフェース用 簡易SIOドライバ
    5757 */
    58 import("tSCIF.cdl");
     58import("tMbedSerial.cdl");
    5959
    6060/*
     
    7474        call                    sSIOPort        cSIOPort;
    7575        [inline] entry  siSIOCBR        eiSIOCBR;
    76 
    77         /*
    78          *  割込み要求ライン操作のための結合
    79          */
    80         call    sInterruptRequest       cRxInterruptRequest;
    81         call    sInterruptRequest       cTxInterruptRequest;
    8276};
    8377
     
    8680 *  ト)のセルタイプ
    8781 */
    88 [active]
    8982composite tSIOPortGRCitrus {
    9083        /*
     
    9891         */
    9992        attr {
    100                 uintptr_t       baseAddress;                            /* ベースアドレス */
    101                 INTNO           rxInterruptNumber;                      /* 受信割込み番号 */
    102                 INTNO           txInterruptNumber;                      /* 送信割込み番号 */
    103                 PRI                     isrPriority = 1;                        /* ISR優先度 */
    104                 PRI                     interruptPriority = -4;         /* 割込み優先度 */
     93                int32_t tx;                                                             /* 送信Pin */
     94                int32_t rx;                                                             /* 受信Pin */
    10595                uint32_t        baudRate = 115200;                      /* ボーレートの設定値 */
    10696        };
     
    10999         *  SIOドライバ
    110100         */
    111         cell tSCIF SCIF {
    112                 baseAddress = composite.baseAddress;
     101        cell tMbedSerial MbedSerial {
     102                tx          = composite.tx;
     103                rx          = composite.rx;
    113104                baudRate    = composite.baudRate;
    114105                ciSIOCBR    = SIOPortMain.eiSIOCBR;
     
    120111        cell tSIOPortGRCitrusMain SIOPortMain {
    121112                ciSIOCBR            => composite.ciSIOCBR;
    122                 cSIOPort            = SCIF.eSIOPort;
    123                 cRxInterruptRequest = RxInterruptRequest.eInterruptRequest;
    124                 cTxInterruptRequest = TxInterruptRequest.eInterruptRequest;
     113                cSIOPort            = MbedSerial.eSIOPort;
    125114        };
    126115        composite.eSIOPort => SIOPortMain.eSIOPort;
    127 
    128         /*
    129          *  SIOの受信割込みサービスルーチンと割込み要求ライン
    130          */
    131         cell tISR RxISRInstance {
    132                 interruptNumber = composite.rxInterruptNumber;
    133                 isrPriority     = composite.isrPriority;
    134                 ciISRBody       = SCIF.eiRxISR;
    135         };
    136         cell tInterruptRequest RxInterruptRequest {
    137                 interruptNumber   = composite.rxInterruptNumber;
    138                 interruptPriority = composite.interruptPriority;
    139         };
    140 
    141         /*
    142          *  SIOの受信割込みサービスルーチンと割込み要求ライン
    143          */
    144         cell tISR TxISRInstance {
    145                 interruptNumber = composite.txInterruptNumber;
    146                 isrPriority     = composite.isrPriority;
    147                 ciISRBody       = SCIF.eiTxISR;
    148         };
    149         cell tInterruptRequest TxInterruptRequest {
    150                 interruptNumber   = composite.txInterruptNumber;
    151                 interruptPriority = composite.interruptPriority;
    152         };
    153116};
    154117
     
    158121 *  サンプルプログラムが使うポートが,SIOPortTarget1に固定されているた
    159122 *  め,ポート1とポート3を入れ換えている.具体的には,SIOPortTarget1は
    160  *  SCIFのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,
    161  *  SIOPortTarget3はSCIFのチャネル0につながっている.
     123 *  MbedSerialのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,
     124 *  SIOPortTarget3はMbedSerialのチャネル0につながっている.
    162125 */
    163126[prototype]
    164127cell tSIOPortGRCitrus SIOPortTarget1 {
    165128        /* 属性の設定 */
    166         baseAddress       = C_EXP("SCI0_BASE");
    167         rxInterruptNumber = C_EXP("INT_SCI0_RXI");
    168         txInterruptNumber = C_EXP("INT_SCI0_TEI");
     129        tx = C_EXP("P20");              /* PIN_IO0 */
     130        rx = C_EXP("P21");              /* PIN_IO1 */
    169131};
    170132
     
    172134cell tSIOPortGRCitrus SIOPortTarget2 {
    173135        /* 属性の設定 */
    174         baseAddress       = C_EXP("SCI1_BASE");
    175         rxInterruptNumber = C_EXP("INT_SCI1_RXI");
    176         txInterruptNumber = C_EXP("INT_SCI1_TEI");
     136        tx = C_EXP("P50");              /* PIN_IO5 */
     137        rx = C_EXP("P52");              /* PIN_IO6 */
    177138};
    178139
     
    180141cell tSIOPortGRCitrus SIOPortTarget3 {
    181142        /* 属性の設定 */
    182         baseAddress       = C_EXP("SCI2_BASE");
    183         rxInterruptNumber = C_EXP("INT_SCI2_RXI");
    184         txInterruptNumber = C_EXP("INT_SCI2_TEI");
     143        tx = C_EXP("P32");              /* PIN_IO7 */
     144        rx = C_EXP("P33");              /* PIN_IO8 */
    185145};
    186146
     
    188148cell tSIOPortGRCitrus SIOPortTarget4 {
    189149        /* 属性の設定 */
    190         baseAddress       = C_EXP("SCI3_BASE");
    191         rxInterruptNumber = C_EXP("INT_SCI3_RXI");
    192         txInterruptNumber = C_EXP("INT_SCI3_TEI");
     150        tx = C_EXP("PC7");              /* PIN_IO12 */
     151        rx = C_EXP("PC6");              /* PIN_IO11 */
    193152};
    194153
     
    196155cell tSIOPortGRCitrus SIOPortTarget5 {
    197156        /* 属性の設定 */
    198         baseAddress       = C_EXP("SCI4_BASE");
    199         rxInterruptNumber = C_EXP("INT_SCI4_RXI");
    200         txInterruptNumber = C_EXP("INT_SCI4_TEI");
     157        tx = C_EXP("P26");              /* PIN_IO26 */
     158        rx = C_EXP("P30");              /* PIN_IO22 */
    201159};
    202160
     
    204162cell tSIOPortGRCitrus SIOPortTarget6 {
    205163        /* 属性の設定 */
    206         baseAddress       = C_EXP("SCI5_BASE");
    207         rxInterruptNumber = C_EXP("INT_SCI5_RXI");
    208         txInterruptNumber = C_EXP("INT_SCI5_TEI");
     164        tx = C_EXP("PB5");              /* PIN_IO29 */
     165        rx = C_EXP("P25");              /* PIN_IO23 */
    209166};
    210167
     
    212169cell tSIOPortGRCitrus SIOPortTarget7 {
    213170        /* 属性の設定 */
    214         baseAddress       = C_EXP("SCI6_BASE");
    215         rxInterruptNumber = C_EXP("INT_SCI6_RXI");
    216         txInterruptNumber = C_EXP("INT_SCI6_TEI");
     171        tx = C_EXP("PA0");              /* PIN_IO33 */
     172        rx = C_EXP("PC2");              /* PIN_IO4 */
    217173};
    218174
     
    220176cell tSIOPortGRCitrus SIOPortTarget8 {
    221177        /* 属性の設定 */
    222         baseAddress       = NULL;
    223         rxInterruptNumber = NULL;
    224         txInterruptNumber = NULL;
     178        rx = NULL;
     179        tx = NULL;
    225180};
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/tSIOPortGRCitrusMain_inline.h

    r337 r374  
    5757         */
    5858        cSIOPort_open();
    59 
    60         /*
    61          *  SIOの割込みマスクを解除する.
    62          */
    63         cRxInterruptRequest_enable();
    64         cTxInterruptRequest_enable();
    6559}
    6660
     
    7771         */
    7872        cSIOPort_close();
    79 
    80         /*
    81          *  SIOの割込みをマスクする.
    82          */
    83         cRxInterruptRequest_disable();
    84         cTxInterruptRequest_disable();
    8573}
    8674
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_kernel_impl.c

    r364 r374  
    5353#include "syssvc/serial.h"
    5454#ifdef TOPPERS_OMIT_TECS
    55 #include "rx630_uart.h"
     55#include "serial_api.h"
     56#endif
     57
     58#ifdef TOPPERS_OMIT_TECS
     59serial_t log_serial;
    5660#endif
    5761
     
    7579                sil_reb_mem(PORTA_PDR_ADDR) & ~PORT_PDR_B7_BIT);
    7680
     81#ifdef TOPPERS_OMIT_TECS
    7782        /*
    7883         *  シリアルポートの設定
    7984         */
    80 
    81         /* ポートP20をTxD0, ポートP21をRxD0に */
    82         sil_wrb_mem(PORT2_PMR_ADDR, 0x03);
    83 
    84         /* データディレクションレジスタ(PDR)の設定 P21(RxD0)を入力ポートにする */
    85         sil_wrb_mem(PORT2_PDR_ADDR,
    86                 sil_reb_mem(PORT2_PDR_ADDR) & ~PORT_PDR_B1_BIT);
    87 
    88         /* データディレクションレジスタ(PDR)の設定 P20(TxD0)を出力ポートにする */
    89         sil_wrb_mem(PORT2_PDR_ADDR,
    90                 sil_reb_mem(PORT2_PDR_ADDR) | PORT_PDR_B0_BIT);
     85        serial_init(&log_serial, P20, P21);
     86        serial_baud(&log_serial, UART_BAUDRATE);
     87        serial_format(&log_serial, 8, ParityNone, 1);
     88#endif
    9189
    9290        /* ポートP40~P47を周辺機器に */
     
    149147{
    150148        if (c == '\n') {
    151                 rx630_uart_pol_putc('\r', TARGET_PUTC_PORTID);
     149                serial_putc(&log_serial, '\r');
    152150        }
    153151
    154         rx630_uart_pol_putc(c, TARGET_PUTC_PORTID);
     152        serial_putc(&log_serial, c);
    155153}
    156154#endif
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_serial.c

    r337 r374  
    33 *      Toyohashi Open Platform for Embedded Real-Time Systems/
    44 *      Advanced Standard Profile Kernel
    5  * 
     5 *
    66 *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
    77 *                              Toyohashi Univ. of Technology, JAPAN
     
    1212 *  Copyright (C) 2008-2010 by Witz Corporation, JAPAN
    1313 *  Copyright (C) 2013      by Mitsuhiro Matsuura
    14  * 
     14 *
    1515 *  上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
    1616 *  ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
     
    3535 *      由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
    3636 *      免責すること.
    37  * 
     37 *
    3838 *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
    3939 *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
     
    4141 *  アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
    4242 *  の責任を負わない.
    43  * 
     43 *
    4444 *  @(#) $Id$
    4545 */
     
    5151#include <sil.h>
    5252#include "target_serial.h"
     53#include "hal/serial_api.h"
     54#include "target_syssvc.h"
     55#include "syssvc/serial.h"
     56
     57/*
     58 *  シリアルI/Oポート初期化ブロックの定義
     59 */
     60typedef struct sio_port_initialization_block {
     61        PinName tx;
     62        PinName rx;
     63} SIOPINIB;
     64
     65/*
     66 *  シリアルI/Oポート管理ブロックの定義
     67 */
     68struct sio_port_control_block {
     69        const SIOPINIB *p_siopinib;
     70        intptr_t exinf;
     71        bool_t openflag;
     72        serial_t serial;
     73};
     74
     75/*
     76 *  シリアルI/Oポート管理ブロックのエリア
     77 */
     78SIOPCB siopcb_table[TNUM_PORT];
     79
     80static const SIOPINIB siopinib_table[TNUM_SIOP] =
     81{
     82        { P20, P21 },
     83#if TNUM_SIOP > 1
     84        { P50, P52 },
     85#endif
     86#if TNUM_SIOP > 2
     87        { P32, P33 },
     88#endif
     89#if TNUM_SIOP > 3
     90        { PC7, PC6 },
     91#endif
     92#if TNUM_SIOP > 4
     93        { P26, P30 },
     94#endif
     95#if TNUM_SIOP > 5
     96        { PB5, P25 },
     97#endif
     98#if TNUM_SIOP > 6
     99        { PA0, PC2 },
     100#endif
     101};
     102
     103/*
     104 *  シリアルI/OポートIDから管理ブロックを取り出すためのマクロ
     105 */
     106#define INDEX_SIOP(siopid)       ((uint_t)((siopid) - 1))
     107#define get_siopcb(siopid)       (&(siopcb_table[INDEX_SIOP(siopid)]))
     108#define get_siopinib(siopid) (&(siopinib_table[INDEX_SIOP(siopid)]))
     109
     110static void mbed_serial_irq_handler(uint32_t id, SerialIrq event);
    53111
    54112/*
     
    58116sio_initialize(intptr_t exinf)
    59117{
    60         rx630_uart_initialize();
     118        SIOPCB  *p_siopcb;
     119        uint_t  i;
     120
     121        /*
     122         *  シリアルI/Oポート管理ブロックの初期化
     123         */
     124        for (p_siopcb = siopcb_table, i = 0; i < TNUM_SIOP; p_siopcb++, i++) {
     125                p_siopcb->p_siopinib = &(siopinib_table[i]);
     126                p_siopcb->openflag = false;
     127        }
    61128}
    62129
     
    69136        SIOPCB  *p_siopcb = NULL;
    70137        ER      ercd;
    71         INTNO   intno_sio_tx, intno_sio_rx;
    72        
    73         /*
    74          *  シリアルI/O割込みをマスクする.
    75          *  (dis_int関数は、"\kernel\interrupt.c"に記述)
    76          */
    77         p_siopcb = rx630_uart_get_siopcb(siopid);
    78         intno_sio_tx = rx630_uart_intno_tx(p_siopcb);
    79         intno_sio_rx = rx630_uart_intno_rx(p_siopcb);
    80         ercd = dis_int(intno_sio_tx);
    81         assert(ercd == E_OK);
    82         ercd = dis_int(intno_sio_rx);
    83         assert(ercd == E_OK);
    84        
    85         p_siopcb =
    86                 rx630_uart_opn_por(siopid , exinf , UART_BAUDRATE , UART_CLKSRC);
    87 
    88         /*
    89          *  シリアルI/O割込みをマスク解除する.
    90          *  (ena_int関数は、"\kernel\interrupt.c"に記述)
    91          */
    92         ercd = ena_int(intno_sio_tx);
    93         assert(ercd == E_OK);
    94         ercd = ena_int(intno_sio_rx);
    95         assert(ercd == E_OK);
    96 
    97         return(p_siopcb);
     138        serial_t *serial;
     139
     140        if ((siopid <= 0) || (siopid > (sizeof(siopcb_table) / sizeof(siopcb_table[0]))))
     141                return NULL;
     142        p_siopcb = get_siopcb(siopid);
     143
     144        if (p_siopcb->openflag)
     145                return NULL;
     146        p_siopcb->openflag = true;
     147        p_siopcb->exinf = exinf;
     148
     149        serial = &p_siopcb->serial;
     150        serial_init(serial, p_siopcb->p_siopinib->tx, p_siopcb->p_siopinib->rx);
     151        serial_baud(serial, UART_BAUDRATE);
     152        serial_format(serial, 8, ParityNone, 1);
     153
     154        serial_irq_handler(serial, mbed_serial_irq_handler, siopid);
     155
     156        return p_siopcb;
    98157}
    99158
     
    105164{
    106165        ER        ercd;
    107         INTNO   intno_sio_tx, intno_sio_rx;
     166        serial_t *serial = &p_siopcb->serial;
    108167
    109168        /*
    110169         *  デバイス依存のクローズ処理.
    111170         */
    112         rx630_uart_cls_por(p_siopcb);
    113        
    114         /*
    115          *  シリアルI/O割込みをマスクする.
    116          */
    117         intno_sio_tx = rx630_uart_intno_tx(p_siopcb);
    118         intno_sio_rx = rx630_uart_intno_rx(p_siopcb);
    119         ercd = dis_int(intno_sio_tx);
    120         assert(ercd == E_OK);
    121         ercd = dis_int(intno_sio_rx);
    122         assert(ercd == E_OK);
     171        serial_free(serial);
     172        p_siopcb->openflag = false;
     173}
     174
     175/*
     176 *  シリアルI/Oポートへの文字送信
     177 */
     178bool_t
     179sio_snd_chr(SIOPCB *p_siopcb, char c)
     180{
     181        serial_t *serial = &p_siopcb->serial;
     182        if (!serial_writable(serial))
     183                return false;
     184        serial_putc(serial, c);
     185        return true;
     186}
     187
     188/*
     189 *  シリアルI/Oポートからの文字受信
     190 */
     191int_t
     192sio_rcv_chr(SIOPCB *p_siopcb)
     193{
     194        serial_t *serial = &p_siopcb->serial;
     195        if (!serial_readable(serial))
     196                return -1;
     197        return serial_getc(serial);
     198}
     199
     200/*
     201 *  シリアルI/Oポートからのコールバックの許可
     202 */
     203void
     204sio_ena_cbr(SIOPCB *p_siopcb, uint_t cbrtn)
     205{
     206        serial_t *serial = &p_siopcb->serial;
     207        switch (cbrtn) {
     208        case SIO_RDY_SND:
     209                serial_irq_set(serial, TxIrq, true);
     210                break;
     211        case SIO_RDY_RCV:
     212                serial_irq_set(serial, RxIrq, true);
     213                break;
     214        }
     215}
     216
     217/*
     218 *  シリアルI/Oポートからのコールバックの禁止
     219 */
     220void
     221sio_dis_cbr(SIOPCB *p_siopcb, uint_t cbrtn)
     222{
     223        serial_t *serial = &p_siopcb->serial;
     224        switch (cbrtn) {
     225        case SIO_RDY_SND:
     226                serial_irq_set(serial, TxIrq, false);
     227                break;
     228        case SIO_RDY_RCV:
     229                serial_irq_set(serial, RxIrq, false);
     230                break;
     231        }
     232}
     233
     234/*
     235 *  シリアルI/Oポートからの送信可能コールバック
     236 */
     237void
     238serial_irdy_snd(SIOPCB  *p_siopcb)
     239{
     240        /* 共通部(syssvc\serial.c)にあるsio_irdy_snd関数を呼び出し*/
     241        sio_irdy_snd(p_siopcb->exinf);
     242}
     243
     244/*
     245 *  シリアルI/Oポートからの受信通知コールバック
     246 */
     247void
     248serial_irdy_rcv(SIOPCB  *p_siopcb)
     249{
     250        /* 共通部(syssvc\serial.c)にあるsio_irdy_rcv関数を呼び出し*/
     251        sio_irdy_rcv(p_siopcb->exinf);
    123252}
    124253
     
    126255 *  SIOの割込みハンドラ
    127256 */
    128 void sio_tx_isr(intptr_t exinf)
    129 {
    130         rx630_uart_tx_isr(exinf);
    131 }
    132 
    133 /*
    134  *  SIOの割込みハンドラ
    135  */
    136 void sio_rx_isr(intptr_t exinf)
    137 {
    138         rx630_uart_rx_isr(exinf);
    139 }
    140 
    141 /*
    142  *  シリアルI/Oポートへの文字送信
    143  */
    144 bool_t
    145 sio_snd_chr(SIOPCB *siopcb, char c)
    146 {
    147         return(rx630_uart_snd_chr(siopcb, c));
    148 }
    149 
    150 /*
    151  *  シリアルI/Oポートからの文字受信
    152  */
    153 int_t
    154 sio_rcv_chr(SIOPCB *siopcb)
    155 {
    156         return(rx630_uart_rcv_chr(siopcb));
    157 }
    158 
    159 /*
    160  *  シリアルI/Oポートからのコールバックの許可
    161  */
    162 void
    163 sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn)
    164 {
    165         rx630_uart_ena_cbr(siopcb, cbrtn);
    166 }
    167 
    168 /*
    169  *  シリアルI/Oポートからのコールバックの禁止
    170  */
    171 void
    172 sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn)
    173 {
    174         rx630_uart_dis_cbr(siopcb, cbrtn);
    175 }
    176 
    177 /*
    178  *  シリアルI/Oポートからの送信可能コールバック
    179  */
    180 void
    181 rx630_uart_irdy_snd(intptr_t exinf)
    182 {
    183         /* 共通部(syssvc\serial.c)にあるsio_irdy_snd関数を呼び出し*/
    184         sio_irdy_snd(exinf);
    185 }
    186 
    187 /*
    188  *  シリアルI/Oポートからの受信通知コールバック
    189  */
    190 void
    191 rx630_uart_irdy_rcv(intptr_t exinf)
    192 {
    193         /* 共通部(syssvc\serial.c)にあるsio_irdy_rcv関数を呼び出し*/
    194         sio_irdy_rcv(exinf);
    195 }
    196 
     257void
     258mbed_serial_irq_handler(uint32_t siopid, SerialIrq event)
     259{
     260        SIOPCB  *p_siopcb;
     261
     262        if ((siopid <= 0) || (siopid > (sizeof(siopcb_table) / sizeof(siopcb_table[0]))))
     263                return;
     264        p_siopcb = get_siopcb(siopid);
     265
     266        if (!p_siopcb->openflag)
     267                return;
     268
     269        switch (event) {
     270        case TxIrq:
     271                serial_irdy_snd(p_siopcb);
     272                break;
     273        case RxIrq:
     274                serial_irdy_rcv(p_siopcb);
     275                break;
     276        }
     277}
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_serial.cfg

    r337 r374  
    44
    55#include <target_serial.h>
     6
    67ATT_INI({ TA_NULL, 0, sio_initialize });
    7 CFG_INT(INTNO_SIO_TX, { INTATR_SIO, INTPRI_SIO });
    8 CFG_INT(INTNO_SIO_RX, { INTATR_SIO, INTPRI_SIO });
    98
    10 CRE_ISR(INTNO_SIO_TX_ISR, {TA_NULL, SIO_PORTID, INTNO_SIO_TX, sio_tx_isr, 1});
    11 CRE_ISR(INTNO_SIO_RX_ISR, {TA_NULL, SIO_PORTID, INTNO_SIO_RX, sio_rx_isr, 1});
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_serial.h

    r337 r374  
    5353
    5454#include "gr_citrus.h"
    55 #include "rx630_uart.h"
     55#include "serial_api.h"
    5656
    57 /*
    58  *  SIOの割込みハンドラのベクタ番号
    59  */
    60 #define INHNO_SIO_TX    INT_SCI1_TEI                    /* 割込みハンドラ番号 */
    61 #define INTNO_SIO_TX    INT_SCI1_TEI                    /* 割込み番号 */
    62 #define INHNO_SIO_RX    INT_SCI1_RXI                    /* 割込みハンドラ番号 */
    63 #define INTNO_SIO_RX    INT_SCI1_RXI                    /* 割込み番号 */
    64 #define INTPRI_SIO              -4                                              /* 割込み優先度 */
    65 #define INTATR_SIO              (TA_NULL)                               /* 割込み属性 */
     57#define SIO_RDY_SND 1
     58#define SIO_RDY_RCV 2
    6659
    6760#ifndef TOPPERS_MACRO_ONLY
    6861
     62typedef struct sio_port_control_block SIOPCB;
    6963
    7064/*
     
    8276 */
    8377extern void             sio_cls_por(SIOPCB *p_siopcb);
    84 
    85 /*
    86  *  SIOの割込みハンドラ
    87  */
    88 extern void     sio_tx_isr(intptr_t exinf);
    89 extern void     sio_rx_isr(intptr_t exinf);
    9078
    9179/*
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_syssvc.h

    r337 r374  
    113113
    114114/*
     115 *  使用するシリアルポートのPinName
     116 */
     117#define STDIO_UART_TX P20
     118#define STDIO_UART_RX P21
     119
     120/*
    115121 *  システムログタスク関連の定数の定義
    116122 *
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/Makefile.target

    r337 r374  
    1313#  コンパイルオプション
    1414#
    15 INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/pdic
     15INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/mbed
    1616
    1717#
     
    2525#  システムサービスに関する定義
    2626#
    27 SYSSVC_DIRS := $(SYSSVC_DIRS)
     27SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/mbed
    2828SYSSVC_COBJS := $(SYSSVC_COBJS)
    2929
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/gr_sakura.h

    r337 r374  
    7171 *  ボーレート設定
    7272 */
    73 #define BAUD_19200BPS           UINT_C( 78 )
    74 #define BAUD_38400BPS           UINT_C( 39 )
    75 #define BAUD_57600BPS           UINT_C( 25 )
    76 #define BAUD_115200BPS          UINT_C( 12 )
    77 
    78 #define UART_BAUDRATE           BAUD_115200BPS
     73#define UART_BAUDRATE           115200
    7974
    8075/*
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/tSIOPortGRSakura.cdl

    r337 r374  
    5151 */
    5252import_C("gr_sakura.h");
    53 import_C("rx630.h");
     53import_C("device.h");
    5454
    5555/*
    5656 *  FIFO内蔵シリアルコミュニケーションインタフェース用 簡易SIOドライバ
    5757 */
    58 import("tSCIF.cdl");
     58import("tMbedSerial.cdl");
    5959
    6060/*
     
    7474        call                    sSIOPort        cSIOPort;
    7575        [inline] entry  siSIOCBR        eiSIOCBR;
    76 
    77         /*
    78          *  割込み要求ライン操作のための結合
    79          */
    80         call    sInterruptRequest       cRxInterruptRequest;
    81         call    sInterruptRequest       cTxInterruptRequest;
    8276};
    8377
     
    8680 *  ト)のセルタイプ
    8781 */
    88 [active]
    8982composite tSIOPortGRSakura {
    9083        /*
     
    9891         */
    9992        attr {
    100                 uintptr_t       baseAddress;                            /* ベースアドレス */
    101                 INTNO           rxInterruptNumber;                      /* 受信割込み番号 */
    102                 INTNO           txInterruptNumber;                      /* 送信割込み番号 */
    103                 PRI                     isrPriority = 1;                        /* ISR優先度 */
    104                 PRI                     interruptPriority = -4;         /* 割込み優先度 */
     93                int32_t tx;                                                             /* 送信Pin */
     94                int32_t rx;                                                             /* 受信Pin */
    10595                uint32_t        baudRate = 115200;                      /* ボーレートの設定値 */
    10696        };
     
    10999         *  SIOドライバ
    110100         */
    111         cell tSCIF SCIF {
    112                 baseAddress = composite.baseAddress;
     101        cell tMbedSerial MbedSerial {
     102                tx          = composite.tx;
     103                rx          = composite.rx;
    113104                baudRate    = composite.baudRate;
    114105                ciSIOCBR    = SIOPortMain.eiSIOCBR;
     
    120111        cell tSIOPortGRSakuraMain SIOPortMain {
    121112                ciSIOCBR            => composite.ciSIOCBR;
    122                 cSIOPort            = SCIF.eSIOPort;
    123                 cRxInterruptRequest = RxInterruptRequest.eInterruptRequest;
    124                 cTxInterruptRequest = TxInterruptRequest.eInterruptRequest;
     113                cSIOPort            = MbedSerial.eSIOPort;
    125114        };
    126115        composite.eSIOPort => SIOPortMain.eSIOPort;
    127 
    128         /*
    129          *  SIOの受信割込みサービスルーチンと割込み要求ライン
    130          */
    131         cell tISR RxISRInstance {
    132                 interruptNumber = composite.rxInterruptNumber;
    133                 isrPriority     = composite.isrPriority;
    134                 ciISRBody       = SCIF.eiRxISR;
    135         };
    136         cell tInterruptRequest RxInterruptRequest {
    137                 interruptNumber   = composite.rxInterruptNumber;
    138                 interruptPriority = composite.interruptPriority;
    139         };
    140 
    141         /*
    142          *  SIOの受信割込みサービスルーチンと割込み要求ライン
    143          */
    144         cell tISR TxISRInstance {
    145                 interruptNumber = composite.txInterruptNumber;
    146                 isrPriority     = composite.isrPriority;
    147                 ciISRBody       = SCIF.eiTxISR;
    148         };
    149         cell tInterruptRequest TxInterruptRequest {
    150                 interruptNumber   = composite.txInterruptNumber;
    151                 interruptPriority = composite.interruptPriority;
    152         };
    153116};
    154117
     
    158121 *  サンプルプログラムが使うポートが,SIOPortTarget1に固定されているた
    159122 *  め,ポート1とポート3を入れ換えている.具体的には,SIOPortTarget1は
    160  *  SCIFのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,
    161  *  SIOPortTarget3はSCIFのチャネル0につながっている.
     123 *  MbedSerialのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,
     124 *  SIOPortTarget3はMbedSerialのチャネル0につながっている.
    162125 */
    163126[prototype]
    164127cell tSIOPortGRSakura SIOPortTarget1 {
    165128        /* 属性の設定 */
    166         baseAddress       = C_EXP("SCI0_BASE");
    167         rxInterruptNumber = C_EXP("INT_SCI0_RXI");
    168         txInterruptNumber = C_EXP("INT_SCI0_TEI");
     129        tx = C_EXP("P20");              /* PIN_IO1 */
     130        rx = C_EXP("P21");              /* PIN_IO0 */
    169131};
    170132
     
    172134cell tSIOPortGRSakura SIOPortTarget2 {
    173135        /* 属性の設定 */
    174         baseAddress       = C_EXP("SCI1_BASE");
    175         rxInterruptNumber = C_EXP("INT_SCI1_RXI");
    176         txInterruptNumber = C_EXP("INT_SCI1_TEI");
     136        tx = C_EXP("P32");              /* PIN_IO6 */
     137        rx = C_EXP("P33");              /* PIN_IO7 */
    177138};
    178139
     
    180141cell tSIOPortGRSakura SIOPortTarget3 {
    181142        /* 属性の設定 */
    182         baseAddress       = C_EXP("SCI2_BASE");
    183         rxInterruptNumber = C_EXP("INT_SCI2_RXI");
    184         txInterruptNumber = C_EXP("INT_SCI2_TEI");
     143        tx = C_EXP("P50");              /* PIN_IO24 */
     144        rx = C_EXP("P52");              /* PIN_IO26 */
    185145};
    186146
     
    188148cell tSIOPortGRSakura SIOPortTarget4 {
    189149        /* 属性の設定 */
    190         baseAddress       = C_EXP("SCI3_BASE");
    191         rxInterruptNumber = C_EXP("INT_SCI3_RXI");
    192         txInterruptNumber = C_EXP("INT_SCI3_TEI");
     150        tx = C_EXP("P23");              /* PIN_IO3 */
     151        rx = C_EXP("P25");              /* PIN_IO5 */
    193152};
    194153
     
    196155cell tSIOPortGRSakura SIOPortTarget5 {
    197156        /* 属性の設定 */
    198         baseAddress       = C_EXP("SCI4_BASE");
    199         rxInterruptNumber = C_EXP("INT_SCI4_RXI");
    200         txInterruptNumber = C_EXP("INT_SCI4_TEI");
     157        tx = C_EXP("PC3");              /* PIN_IO9 */
     158        rx = C_EXP("PC2");              /* PIN_IO8 */
    201159};
    202160
     
    204162cell tSIOPortGRSakura SIOPortTarget6 {
    205163        /* 属性の設定 */
    206         baseAddress       = C_EXP("SCI5_BASE");
    207         rxInterruptNumber = C_EXP("INT_SCI5_RXI");
    208         txInterruptNumber = C_EXP("INT_SCI5_TEI");
     164        tx = C_EXP("PC7");              /* PIN_IO12 */
     165        rx = C_EXP("PC6");              /* PIN_IO11 */
    209166};
    210167
     
    212169cell tSIOPortGRSakura SIOPortTarget7 {
    213170        /* 属性の設定 */
    214         baseAddress       = C_EXP("SCI6_BASE");
    215         rxInterruptNumber = C_EXP("INT_SCI6_RXI");
    216         txInterruptNumber = C_EXP("INT_SCI6_TEI");
     171        tx = C_EXP("P26");              /* PIN_IO58 */
     172        rx = C_EXP("P30");              /* PIN_IO60 */
    217173};
    218174
     
    220176cell tSIOPortGRSakura SIOPortTarget8 {
    221177        /* 属性の設定 */
    222         baseAddress       = NULL;
    223         rxInterruptNumber = NULL;
    224         txInterruptNumber = NULL;
     178        tx = NULL;
     179        rx = NULL;
    225180};
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/tSIOPortGRSakuraMain_inline.h

    r337 r374  
    5757         */
    5858        cSIOPort_open();
    59 
    60         /*
    61          *  SIOの割込みマスクを解除する.
    62          */
    63         cRxInterruptRequest_enable();
    64         cTxInterruptRequest_enable();
    6559}
    6660
     
    7771         */
    7872        cSIOPort_close();
    79 
    80         /*
    81          *  SIOの割込みをマスクする.
    82          */
    83         cRxInterruptRequest_disable();
    84         cTxInterruptRequest_disable();
    8573}
    8674
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_kernel_impl.c

    r364 r374  
    5353#include "syssvc/serial.h"
    5454#ifdef TOPPERS_OMIT_TECS
    55 #include "rx630_uart.h"
     55#include "serial_api.h"
     56#endif
     57
     58#ifdef TOPPERS_OMIT_TECS
     59serial_t log_serial;
    5660#endif
    5761
     
    7882                sil_reb_mem(PORTA_PDR_ADDR) & ~PORT_PDR_B7_BIT);
    7983
     84#ifdef TOPPERS_OMIT_TECS
    8085        /*
    8186         *  シリアルポートの設定
    8287         */
    83 
    84         /* ポートP20をTxD0, ポートP21をRxD0に */
    85         sil_wrb_mem(PORT2_PMR_ADDR, 0x03);
    86 
    87         /* データディレクションレジスタ(PDR)の設定 P21(RxD0)を入力ポートにする */
    88         sil_wrb_mem(PORT2_PDR_ADDR,
    89                 sil_reb_mem(PORT2_PDR_ADDR) & ~PORT_PDR_B1_BIT);
    90 
    91         /* データディレクションレジスタ(PDR)の設定 P20(TxD0)を出力ポートにする */
    92         sil_wrb_mem(PORT2_PDR_ADDR,
    93                 sil_reb_mem(PORT2_PDR_ADDR) | PORT_PDR_B0_BIT);
     88        serial_init(&log_serial, P20, P21);
     89        serial_baud(&log_serial, UART_BAUDRATE);
     90        serial_format(&log_serial, 8, ParityNone, 1);
     91#endif
    9492
    9593        /* ポートP40~P47を周辺機器に */
     
    152150{
    153151        if (c == '\n') {
    154                 rx630_uart_pol_putc('\r', TARGET_PUTC_PORTID);
     152                serial_putc(&log_serial, '\r');
    155153        }
    156154
    157         rx630_uart_pol_putc(c, TARGET_PUTC_PORTID);
     155        serial_putc(&log_serial, c);
    158156}
    159157#endif
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_serial.c

    r337 r374  
    33 *      Toyohashi Open Platform for Embedded Real-Time Systems/
    44 *      Advanced Standard Profile Kernel
    5  * 
     5 *
    66 *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
    77 *                              Toyohashi Univ. of Technology, JAPAN
     
    1212 *  Copyright (C) 2008-2010 by Witz Corporation, JAPAN
    1313 *  Copyright (C) 2013      by Mitsuhiro Matsuura
    14  * 
     14 *
    1515 *  上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
    1616 *  ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
     
    3535 *      由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
    3636 *      免責すること.
    37  * 
     37 *
    3838 *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
    3939 *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
     
    4141 *  アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
    4242 *  の責任を負わない.
    43  * 
     43 *
    4444 *  @(#) $Id$
    4545 */
     
    5151#include <sil.h>
    5252#include "target_serial.h"
     53#include "hal/serial_api.h"
     54#include "target_syssvc.h"
     55#include "syssvc/serial.h"
     56
     57/*
     58 *  シリアルI/Oポート初期化ブロックの定義
     59 */
     60typedef struct sio_port_initialization_block {
     61        PinName tx;
     62        PinName rx;
     63} SIOPINIB;
     64
     65/*
     66 *  シリアルI/Oポート管理ブロックの定義
     67 */
     68struct sio_port_control_block {
     69        const SIOPINIB *p_siopinib;
     70        intptr_t exinf;
     71        bool_t openflag;
     72        serial_t serial;
     73};
     74
     75/*
     76 *  シリアルI/Oポート管理ブロックのエリア
     77 */
     78SIOPCB siopcb_table[TNUM_PORT];
     79
     80static const SIOPINIB siopinib_table[TNUM_SIOP] =
     81{
     82        { P20, P21 },
     83#if TNUM_SIOP > 1
     84        { P32, P33 },
     85#endif
     86#if TNUM_SIOP > 2
     87        { P50, P52 },
     88#endif
     89#if TNUM_SIOP > 3
     90        { P23, P25 },
     91#endif
     92#if TNUM_SIOP > 4
     93        { PC3, PC2 },
     94#endif
     95#if TNUM_SIOP > 5
     96        { PC7, PC6 },
     97#endif
     98#if TNUM_SIOP > 6
     99        { P26, P30 },
     100#endif
     101};
     102
     103/*
     104 *  シリアルI/OポートIDから管理ブロックを取り出すためのマクロ
     105 */
     106#define INDEX_SIOP(siopid)       ((uint_t)((siopid) - 1))
     107#define get_siopcb(siopid)       (&(siopcb_table[INDEX_SIOP(siopid)]))
     108#define get_siopinib(siopid) (&(siopinib_table[INDEX_SIOP(siopid)]))
     109
     110static void mbed_serial_irq_handler(uint32_t id, SerialIrq event);
    53111
    54112/*
     
    58116sio_initialize(intptr_t exinf)
    59117{
    60         rx630_uart_initialize();
     118        SIOPCB  *p_siopcb;
     119        uint_t  i;
     120
     121        /*
     122         *  シリアルI/Oポート管理ブロックの初期化
     123         */
     124        for (p_siopcb = siopcb_table, i = 0; i < TNUM_SIOP; p_siopcb++, i++) {
     125                p_siopcb->p_siopinib = &(siopinib_table[i]);
     126                p_siopcb->openflag = false;
     127        }
    61128}
    62129
     
    69136        SIOPCB  *p_siopcb = NULL;
    70137        ER      ercd;
    71         INTNO   intno_sio_tx, intno_sio_rx;
    72        
    73         /*
    74          *  シリアルI/O割込みをマスクする.
    75          *  (dis_int関数は、"\kernel\interrupt.c"に記述)
    76          */
    77         p_siopcb = rx630_uart_get_siopcb(siopid);
    78         intno_sio_tx = rx630_uart_intno_tx(p_siopcb);
    79         intno_sio_rx = rx630_uart_intno_rx(p_siopcb);
    80         ercd = dis_int(intno_sio_tx);
    81         assert(ercd == E_OK);
    82         ercd = dis_int(intno_sio_rx);
    83         assert(ercd == E_OK);
    84        
    85         p_siopcb =
    86                 rx630_uart_opn_por(siopid , exinf , UART_BAUDRATE , UART_CLKSRC);
    87 
    88         /*
    89          *  シリアルI/O割込みをマスク解除する.
    90          *  (ena_int関数は、"\kernel\interrupt.c"に記述)
    91          */
    92         ercd = ena_int(intno_sio_tx);
    93         assert(ercd == E_OK);
    94         ercd = ena_int(intno_sio_rx);
    95         assert(ercd == E_OK);
    96 
    97         return(p_siopcb);
     138        serial_t *serial;
     139
     140        if ((siopid <= 0) || (siopid > (sizeof(siopcb_table) / sizeof(siopcb_table[0]))))
     141                return NULL;
     142        p_siopcb = get_siopcb(siopid);
     143
     144        if (p_siopcb->openflag)
     145                return NULL;
     146        p_siopcb->openflag = true;
     147        p_siopcb->exinf = exinf;
     148
     149        serial = &p_siopcb->serial;
     150        serial_init(serial, p_siopcb->p_siopinib->tx, p_siopcb->p_siopinib->rx);
     151        serial_baud(serial, UART_BAUDRATE);
     152        serial_format(serial, 8, ParityNone, 1);
     153
     154        serial_irq_handler(serial, mbed_serial_irq_handler, siopid);
     155
     156        return p_siopcb;
    98157}
    99158
     
    105164{
    106165        ER        ercd;
    107         INTNO   intno_sio_tx, intno_sio_rx;
     166        serial_t *serial = &p_siopcb->serial;
    108167
    109168        /*
    110169         *  デバイス依存のクローズ処理.
    111170         */
    112         rx630_uart_cls_por(p_siopcb);
    113        
    114         /*
    115          *  シリアルI/O割込みをマスクする.
    116          */
    117         intno_sio_tx = rx630_uart_intno_tx(p_siopcb);
    118         intno_sio_rx = rx630_uart_intno_rx(p_siopcb);
    119         ercd = dis_int(intno_sio_tx);
    120         assert(ercd == E_OK);
    121         ercd = dis_int(intno_sio_rx);
    122         assert(ercd == E_OK);
     171        serial_free(serial);
     172        p_siopcb->openflag = false;
     173}
     174
     175/*
     176 *  シリアルI/Oポートへの文字送信
     177 */
     178bool_t
     179sio_snd_chr(SIOPCB *p_siopcb, char c)
     180{
     181        serial_t *serial = &p_siopcb->serial;
     182        if (!serial_writable(serial))
     183                return false;
     184        serial_putc(serial, c);
     185        return true;
     186}
     187
     188/*
     189 *  シリアルI/Oポートからの文字受信
     190 */
     191int_t
     192sio_rcv_chr(SIOPCB *p_siopcb)
     193{
     194        serial_t *serial = &p_siopcb->serial;
     195        if (!serial_readable(serial))
     196                return -1;
     197        return serial_getc(serial);
     198}
     199
     200/*
     201 *  シリアルI/Oポートからのコールバックの許可
     202 */
     203void
     204sio_ena_cbr(SIOPCB *p_siopcb, uint_t cbrtn)
     205{
     206        serial_t *serial = &p_siopcb->serial;
     207        switch (cbrtn) {
     208        case SIO_RDY_SND:
     209                serial_irq_set(serial, TxIrq, true);
     210                break;
     211        case SIO_RDY_RCV:
     212                serial_irq_set(serial, RxIrq, true);
     213                break;
     214        }
     215}
     216
     217/*
     218 *  シリアルI/Oポートからのコールバックの禁止
     219 */
     220void
     221sio_dis_cbr(SIOPCB *p_siopcb, uint_t cbrtn)
     222{
     223        serial_t *serial = &p_siopcb->serial;
     224        switch (cbrtn) {
     225        case SIO_RDY_SND:
     226                serial_irq_set(serial, TxIrq, false);
     227                break;
     228        case SIO_RDY_RCV:
     229                serial_irq_set(serial, RxIrq, false);
     230                break;
     231        }
     232}
     233
     234/*
     235 *  シリアルI/Oポートからの送信可能コールバック
     236 */
     237void
     238serial_irdy_snd(SIOPCB  *p_siopcb)
     239{
     240        /* 共通部(syssvc\serial.c)にあるsio_irdy_snd関数を呼び出し*/
     241        sio_irdy_snd(p_siopcb->exinf);
     242}
     243
     244/*
     245 *  シリアルI/Oポートからの受信通知コールバック
     246 */
     247void
     248serial_irdy_rcv(SIOPCB  *p_siopcb)
     249{
     250        /* 共通部(syssvc\serial.c)にあるsio_irdy_rcv関数を呼び出し*/
     251        sio_irdy_rcv(p_siopcb->exinf);
    123252}
    124253
     
    126255 *  SIOの割込みハンドラ
    127256 */
    128 void sio_tx_isr(intptr_t exinf)
    129 {
    130         rx630_uart_tx_isr(exinf);
    131 }
    132 
    133 /*
    134  *  SIOの割込みハンドラ
    135  */
    136 void sio_rx_isr(intptr_t exinf)
    137 {
    138         rx630_uart_rx_isr(exinf);
    139 }
    140 
    141 /*
    142  *  シリアルI/Oポートへの文字送信
    143  */
    144 bool_t
    145 sio_snd_chr(SIOPCB *siopcb, char c)
    146 {
    147         return(rx630_uart_snd_chr(siopcb, c));
    148 }
    149 
    150 /*
    151  *  シリアルI/Oポートからの文字受信
    152  */
    153 int_t
    154 sio_rcv_chr(SIOPCB *siopcb)
    155 {
    156         return(rx630_uart_rcv_chr(siopcb));
    157 }
    158 
    159 /*
    160  *  シリアルI/Oポートからのコールバックの許可
    161  */
    162 void
    163 sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn)
    164 {
    165         rx630_uart_ena_cbr(siopcb, cbrtn);
    166 }
    167 
    168 /*
    169  *  シリアルI/Oポートからのコールバックの禁止
    170  */
    171 void
    172 sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn)
    173 {
    174         rx630_uart_dis_cbr(siopcb, cbrtn);
    175 }
    176 
    177 /*
    178  *  シリアルI/Oポートからの送信可能コールバック
    179  */
    180 void
    181 rx630_uart_irdy_snd(intptr_t exinf)
    182 {
    183         /* 共通部(syssvc\serial.c)にあるsio_irdy_snd関数を呼び出し*/
    184         sio_irdy_snd(exinf);
    185 }
    186 
    187 /*
    188  *  シリアルI/Oポートからの受信通知コールバック
    189  */
    190 void
    191 rx630_uart_irdy_rcv(intptr_t exinf)
    192 {
    193         /* 共通部(syssvc\serial.c)にあるsio_irdy_rcv関数を呼び出し*/
    194         sio_irdy_rcv(exinf);
    195 }
    196 
     257void
     258mbed_serial_irq_handler(uint32_t siopid, SerialIrq event)
     259{
     260        SIOPCB  *p_siopcb;
     261
     262        if ((siopid <= 0) || (siopid > (sizeof(siopcb_table) / sizeof(siopcb_table[0]))))
     263                return;
     264        p_siopcb = get_siopcb(siopid);
     265
     266        if (!p_siopcb->openflag)
     267                return;
     268
     269        switch (event) {
     270        case TxIrq:
     271                serial_irdy_snd(p_siopcb);
     272                break;
     273        case RxIrq:
     274                serial_irdy_rcv(p_siopcb);
     275                break;
     276        }
     277}
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_serial.cfg

    r337 r374  
    44
    55#include <target_serial.h>
     6
    67ATT_INI({ TA_NULL, 0, sio_initialize });
    7 CFG_INT(INTNO_SIO_TX, { INTATR_SIO, INTPRI_SIO });
    8 CFG_INT(INTNO_SIO_RX, { INTATR_SIO, INTPRI_SIO });
    98
    10 CRE_ISR(INTNO_SIO_TX_ISR, {TA_NULL, SIO_PORTID, INTNO_SIO_TX, sio_tx_isr, 1});
    11 CRE_ISR(INTNO_SIO_RX_ISR, {TA_NULL, SIO_PORTID, INTNO_SIO_RX, sio_rx_isr, 1});
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_serial.h

    r337 r374  
    5353
    5454#include "gr_sakura.h"
    55 #include "rx630_uart.h"
     55#include "serial_api.h"
    5656
    57 /*
    58  *  SIOの割込みハンドラのベクタ番号
    59  */
    60 #define INHNO_SIO_TX    INT_SCI0_TEI                    /* 割込みハンドラ番号 */
    61 #define INTNO_SIO_TX    INT_SCI0_TEI                    /* 割込み番号 */
    62 #define INHNO_SIO_RX    INT_SCI0_RXI                    /* 割込みハンドラ番号 */
    63 #define INTNO_SIO_RX    INT_SCI0_RXI                    /* 割込み番号 */
    64 #define INTPRI_SIO              -4                                              /* 割込み優先度 */
    65 #define INTATR_SIO              (TA_NULL)                               /* 割込み属性 */
     57#define SIO_RDY_SND 1
     58#define SIO_RDY_RCV 2
    6659
    6760#ifndef TOPPERS_MACRO_ONLY
    6861
     62typedef struct sio_port_control_block SIOPCB;
    6963
    7064/*
     
    8276 */
    8377extern void             sio_cls_por(SIOPCB *p_siopcb);
    84 
    85 /*
    86  *  SIOの割込みハンドラ
    87  */
    88 extern void     sio_tx_isr(intptr_t exinf);
    89 extern void     sio_rx_isr(intptr_t exinf);
    9078
    9179/*
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_syssvc.h

    r337 r374  
    113113
    114114/*
     115 *  使用するシリアルポートのPinName
     116 */
     117#define STDIO_UART_TX P20
     118#define STDIO_UART_RX P21
     119
     120/*
    115121 *  システムログタスク関連の定数の定義
    116122 *
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/MANIFEST_tecsgen_body

    r337 r374  
    11MANIFEST_tecsgen_body
     2
    23Makefile
    3 
     4tecscde
     5tecscde.rb
     6tecsgen
     7tecsgen.rb
     8tecsgen_rcov.rb
     9tecsmerge
     10tecsmerge.rb
    411cdelib/Makefile
    512cdelib/cell_plugin_dialog.rb
     
    1118cdelib/tview.rb
    1219cdelib/version.rb
    13 
    1420tecs/TECSInfo/TECSInfo.cdl
     21tecs/TECSInfo/TECSInfoAccessor.cdl
    1522tecs/TECSInfo/nTECSInfo_tArrayTypeInfo.c
    16 tecs/TECSInfo/nTECSInfo_tAttrVarInfo.c
    1723tecs/TECSInfo/nTECSInfo_tBoolTypeInfo.c
    1824tecs/TECSInfo/nTECSInfo_tCallInfo.c
     
    2834tecs/TECSInfo/nTECSInfo_tParamInfo.c
    2935tecs/TECSInfo/nTECSInfo_tPtrTypeInfo.c
     36tecs/TECSInfo/nTECSInfo_tRawEntryDescriptorInfo.c
    3037tecs/TECSInfo/nTECSInfo_tRegionInfo.c
    3138tecs/TECSInfo/nTECSInfo_tSignatureInfo.c
    3239tecs/TECSInfo/nTECSInfo_tStructTypeInfo.c
     40tecs/TECSInfo/nTECSInfo_tTECSInfoAccessor.c
    3341tecs/TECSInfo/nTECSInfo_tTECSInfoSub.c
    3442tecs/TECSInfo/nTECSInfo_tTECSInfo_inline.h
     
    3644tecs/TECSInfo/nTECSInfo_tVarDeclInfo.c
    3745tecs/TECSInfo/nTECSInfo_tVoidTypeInfo.c
     46tecs/TECSInfo/tTECSInfoAccessor.c
    3847tecs/TLSFMalloc/README-TLSF.txt
    3948tecs/TLSFMalloc/tTLSFMalloc.cdl
     
    6170tecs/mruby/nMruby_tMruby.c
    6271tecs/mruby/nMruby_tMrubyCyclicTaskBody.c
     72tecs/mruby/nMruby_tMrubyProc.c
    6373tecs/mruby/nMruby_tMrubyTaskBody.c
    6474tecs/mruby/nMruby_tMrubyVM.c
     
    8797tecs/rpc/tDataqueueAdaptor_inline.h
    8898tecs/rpc/tDataqueueOWChannel.cdl
     99tecs/rpc/tMessageBufferCEP.cdl
     100tecs/rpc/tMessageBufferCEP_inline.h
     101tecs/rpc/tMessageBufferChannel.cdl
    89102tecs/rpc/tNBOTDR_inline.h
    90103tecs/rpc/tPPAllocator.c
     
    105118tecs/tecs.h
    106119tecs/tecs.xsd
    107 
    108 tecscde
    109 tecscde.rb
    110 tecsgen
    111 tecsgen.rb
    112 tecsgen_rcov
    113 tecsgen_rcov.rb
    114120tecslib/core/C_parser.tab.rb
    115121tecslib/core/C_parser.y.rb
     
    132138tecslib/core/tool_info.rb
    133139tecslib/core/types.rb
     140tecslib/core/unjoin_plugin.rb
    134141tecslib/core/value.rb
    135142tecslib/messages/messages_console_en_US.rb
     
    165172tecslib/plugin/HRP2SemaphorePlugin.rb
    166173tecslib/plugin/HRP2TaskPlugin.rb
     174tecslib/plugin/HRPHandlerPlugin.rb
     175tecslib/plugin/HRPKernelObjectManager.rb
     176tecslib/plugin/HRPKernelObjectPlugin.rb
     177tecslib/plugin/HRPObjectPlugin.rb
     178tecslib/plugin/HRPPlugin.rb
     179tecslib/plugin/HRPRPCPlugin.rb
     180tecslib/plugin/HRPSVCPlugin.rb
     181tecslib/plugin/HRPTaskPlugin.rb
    167182tecslib/plugin/Mruby2CBridgePlugin.rb
    168183tecslib/plugin/MrubyBridgeCellPlugin.rb
    169184tecslib/plugin/MrubyBridgeCelltypePlugin.rb
     185tecslib/plugin/MrubyBridgeCompositePlugin.rb
    170186tecslib/plugin/MrubyBridgePlugin.rb
    171187tecslib/plugin/MrubyBridgeSignaturePlugin.rb
     
    175191tecslib/plugin/OpaqueRPCPlugin.rb
    176192tecslib/plugin/RPCPlugin.rb
     193tecslib/plugin/RepeatCellPlugin.rb
     194tecslib/plugin/RepeatJoinPlugin.rb
    177195tecslib/plugin/SharedOpaqueRPCPlugin.rb
    178196tecslib/plugin/SharedRPCPlugin.rb
     
    186204tecslib/plugin/lib/GenParamCopy.rb
    187205tecslib/plugin/lib/GenTransparentMarshaler.rb
     206tecslib/plugin/lib/MrubyBridgeCelltypePluginModule.rb
    188207tecslib/version.rb
    189 
    190 tecsmerge
    191 tecsmerge.rb
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecs/mruby/TECSPointer.h

    r359 r374  
    102102        {                                                                                                                                       \
    103103                if( sizeof( type ) > sizeof( mrb_int ) ){                                               \
    104                         if( val >= (((type)1) << (sizeof(mrb_int)*8-1))                         \
    105                                 || val < -(((type)1) << (sizeof(mrb_int)*8-1)) )                \
     104                        if( val > TYPE ## _MAX                          \
     105                                || val < TYPE ## _MIN )         \
    106106                                /* '=' unecessary for negative value    */                              \
    107107                                /* ignore warning on int32_t */                                                 \
     
    126126        {                                                                                                                                       \
    127127                if( sizeof( type ) > sizeof( mrb_int ) ){                                               \
    128                         if( val >= (((type)1) << (sizeof(mrb_int)*8)))                          \
     128      if( val > TYPE ## _MAX )                        \
    129129                                /* '=' unecessary for negative value    */                              \
    130130                                /* ignore warning on int32_t */                                                 \
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyVMs.cdl

    r359 r374  
    3737
    3838/*
    39  * tools/mruby/mruby.c から cInit_initializeBridge( mrb ) を呼び出すように変更したもの
     39 * POSIX 環境用の VM
     40 * mrbgems の mrbgems/mruby-bin-mruby/tools/mruby/mruby.c を参考に作成したもの
    4041 */
    4142namespace nMruby{
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecs/mruby/tecs_mruby.h

    r359 r374  
    11/*
    2  *  Copyright (C) 2008-2017 by TOPPERS Project
     2 *  Copyright (C) 2008-2019 by TOPPERS Project
    33 *
    44 *  上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    4646#include "mruby/irep.h"
    4747#include "mruby/dump.h"
     48#include "mruby/proc.h"
    4849
    4950#include "TECSPointer.h"
    5051#include "TECSStruct.h"
    5152
    52 #if  ! defined( MRUBY_RELEASE_MAJOR ) || MRUBY_RELEASE_MAJOR == 1 && MRUBY_RELEASE_MINOR < 2
    53 #ifndef MRB_ARGS_REQ
    54 #define MRB_ARGS_REQ(n)     ARGS_REQ(n)
    55 #define MRB_ARGS_OPT(n)     ARGS_OPT(n)
    56 #define MRB_ARGS_ARG(n1,n2) ARGS_ARG(n1,n2)
    57 #define MRB_ARGS_REST()     ARGS_REST()
    58 #define MRB_ARGS_POST(n)    ARGS_POST(n)
    59 #define MRB_ARGS_KEY(n1,n2) ARGS_KEY(n1,n2)
    60 #define MRB_ARGS_BLOCK()    ARGS_BLOCK()
    61 #define MRB_ARGS_ANY()      ARGS_ANY()
    62 #define MRB_ARGS_NONE()     ARGS_NONE()
    63 #endif /* MRB_ARGS_REQ */
    64 #endif
    6553
    66 #if  ! defined( MRUBY_RELEASE_MAJOR )
    67 #define mrb_float_value( mrb, val )  mrb_float_value( val )
    68 #endif
    69 
    70 #else
     54#else /* TECSGEN */
    7155
    7256/*
    73  * fake tecsgen because tecsgen cannot accept actual mruby.h in case of below.
     57 * fake definition because tecsgen cannot accept actual mruby.h in case of below.
    7458 *   types:   long long, long long int
    7559 *   special keyword __attribute__(x), __extension__
     
    7862typedef int mrb_irep;
    7963typedef int mrb_context;
    80 struct  RClass {int dummy;};
    81 struct  RProc  {int dummy;};
     64struct  RClass {uint32_t gcnext;};  // actual definition: struct RBasic *gcnext
     65struct  RProc  {uint32_t gcnext;};  // actual definition: struct RBasic *gcnext
    8266
    8367typedef int CELLCB;
     68
     69#define GET_SET_BOOL( Type, type )
     70#define GET_SET_CHAR( Type, type )
     71#define GET_SET_INT( Type, type )
     72#define GET_SET_FLOAT( Type, type )
     73#define POINTER_CLASS( Type, type )
     74#define CHECK_AND_GET_POINTER( Type, type )
    8475
    8576#endif /* TECSGEN */
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecs/rpc/TDR.cdl

    r337 r374  
    6868        ER      sendSOP( [in]bool_t b_client );     /* StartOfPacket magic を送信 */
    6969        ER      receiveSOP( [in]bool_t b_client );  /* StartOfPacket magic を受信 */
    70                                                  /* b_client: クライアント側なら true, サーバー側なら false */
    71 
    72         /* マジックコードの送受信 */
    73         //      ER      sendSHSOP( [in]bool_t b_client );     /* StartOfPacket magic を送信 */
    74         //      ER      receiveSHSOP( [in]bool_t b_client );  /* StartOfPacket magic を受信 */
    7570                                                 /* b_client: クライアント側なら true, サーバー側なら false */
    7671
     
    150145};
    151146
    152 // Straight Order TECS Data Representation (Straight means no endian-conversion is done)
     147// Straight Byte Order TECS Data Representation (Data are always sent in native endian)
    153148celltype tTDR {
    154149        call    sChannel        cChannel;
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecs/rpc/sChannel.cdl

    r337 r374  
    5858};
    5959
     60/*
     61 * size に uint16_t ではなく int16_t を用いるのは、下位層が ER_INT を返す場合を想定したもの.
     62 *
     63 * sChannel は TECS RPC の TDR の下位層である通信チャンネルとのインタフェースである.
     64 * 通信チャンネルは、高水準 I/O のように、バッファリングされることを想定する.
     65 * TDR からは、int8_t, int16_t, int32_t, int64_t, (int128_t), float32_t, double64_t bool_t, char_t のような基本型(無符号を含む)が渡される。
     66 * 配列や構造体の場合であっても要素ごとに渡される。
     67 */
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecs/rpc/tTDR_inline.h

    r337 r374  
    7575                return(E_ID);
    7676        }
     77  (void)p_cellcb;   // to avoid unused warning
    7778
    7879        syslog( LOG_INFO, "TDR: resetting channel" );
     
    102103                return(E_ID);
    103104        }
     105  (void)p_cellcb;   // to avoid unused warning
    104106
    105107        /* ここに処理本体を記述します #_TEFB_# */
     
    151153                return(E_ID);
    152154        }
     155  (void)p_cellcb;   // to avoid unused warning
    153156
    154157        /* ここに処理本体を記述します #_TEFB_# */
     
    157160#endif
    158161
    159     if( b_client )
     162  if( b_client )
    160163                p_sopMagic = &SOP_MAGIC2;
    161164        else
     
    198201                return(E_ID);
    199202        }
     203  (void)p_cellcb;   // to avoid unused warning
    200204
    201205        /* ここに処理本体を記述します #_TEFB_# */
     
    234238                return(E_ID);
    235239        }
     240  (void)p_cellcb;   // to avoid unused warning
    236241
    237242        /* ここに処理本体を記述します #_TEFB_# */
     
    267272                return(E_ID);
    268273        }
     274  (void)p_cellcb;   // to avoid unused warning
    269275
    270276        /* ここに処理本体を記述します #_TEFB_# */
     
    287293                return(E_ID);
    288294        }
     295  (void)p_cellcb;   // to avoid unused warning
    289296
    290297        /* ここに処理本体を記述します #_TEFB_# */
     
    307314                return(E_ID);
    308315        }
     316  (void)p_cellcb;   // to avoid unused warning
    309317
    310318        /* ここに処理本体を記述します #_TEFB_# */
     
    327335                return(E_ID);
    328336        }
     337  (void)p_cellcb;   // to avoid unused warning
    329338
    330339        /* ここに処理本体を記述します #_TEFB_# */
     
    347356                return(E_ID);
    348357        }
     358  (void)p_cellcb;   // to avoid unused warning
    349359
    350360        /* ここに処理本体を記述します #_TEFB_# */
     
    368378                return(E_ID);
    369379        }
     380  (void)p_cellcb;   // to avoid unused warning
    370381
    371382        /* ここに処理本体を記述します #_TEFB_# */
     
    390401                return(E_ID);
    391402        }
     403  (void)p_cellcb;   // to avoid unused warning
    392404
    393405        /* ここに処理本体を記述します #_TEFB_# */
     
    412424                return(E_ID);
    413425        }
     426  (void)p_cellcb;   // to avoid unused warning
    414427
    415428        /* ここに処理本体を記述します #_TEFB_# */
     
    434447                return(E_ID);
    435448        }
     449  (void)p_cellcb;   // to avoid unused warning
    436450
    437451        /* ここに処理本体を記述します #_TEFB_# */
     
    456470                return(E_ID);
    457471        }
     472  (void)p_cellcb;   // to avoid unused warning
    458473
    459474        /* ここに処理本体を記述します #_TEFB_# */
     
    477492                return(E_ID);
    478493        } /* end if VALID_IDX(idx) */
     494  (void)p_cellcb;   // to avoid unused warning
    479495
    480496        /* ここに処理本体を記述します #_TEFB_# */
     
    497513                return(E_ID);
    498514        } /* end if VALID_IDX(idx) */
     515  (void)p_cellcb;   // to avoid unused warning
    499516
    500517        /* ここに処理本体を記述します #_TEFB_# */
     
    517534                return(E_ID);
    518535        } /* end if VALID_IDX(idx) */
     536  (void)p_cellcb;   // to avoid unused warning
    519537
    520538        /* ここに処理本体を記述します #_TEFB_# */
     
    537555                return(E_ID);
    538556        } /* end if VALID_IDX(idx) */
     557  (void)p_cellcb;   // to avoid unused warning
    539558
    540559        /* ここに処理本体を記述します #_TEFB_# */
     
    557576                return(E_ID);
    558577        } /* end if VALID_IDX(idx) */
     578  (void)p_cellcb;   // to avoid unused warning
    559579
    560580        /* ここに処理本体を記述します #_TEFB_# */
     
    578598                return(E_ID);
    579599        } /* end if VALID_IDX(idx) */
     600  (void)p_cellcb;   // to avoid unused warning
    580601
    581602        /* ここに処理本体を記述します #_TEFB_# */
     
    600621                return(E_ID);
    601622        } /* end if VALID_IDX(idx) */
     623  (void)p_cellcb;   // to avoid unused warning
    602624
    603625        /* ここに処理本体を記述します #_TEFB_# */
     
    622644                return(E_ID);
    623645        } /* end if VALID_IDX(idx) */
     646  (void)p_cellcb;   // to avoid unused warning
    624647
    625648        /* ここに処理本体を記述します #_TEFB_# */
     
    644667                return(E_ID);
    645668        } /* end if VALID_IDX(idx) */
     669  (void)p_cellcb;   // to avoid unused warning
    646670
    647671        /* ここに処理本体を記述します #_TEFB_# */
     
    666690                return(E_ID);
    667691        } /* end if VALID_IDX(idx) */
     692  (void)p_cellcb;   // to avoid unused warning
    668693
    669694        /* ここに処理本体を記述します #_TEFB_# */
     
    688713                return(E_ID);
    689714        } /* end if VALID_IDX(idx) */
     715  (void)p_cellcb;   // to avoid unused warning
    690716
    691717        /* ここに処理本体を記述します #_TEFB_# */
     
    705731        ER              ercd = E_OK;
    706732        CELLCB  *p_cellcb;
    707         uint8_t val;
    708         if (VALID_IDX(idx)) {
    709                 p_cellcb = GET_CELLCB(idx);
    710         }
    711         else {
    712                 return(E_ID);
    713         } /* end if VALID_IDX(idx) */
     733        uint8_t val = 0;
     734        if (VALID_IDX(idx)) {
     735                p_cellcb = GET_CELLCB(idx);
     736        }
     737        else {
     738                return(E_ID);
     739        } /* end if VALID_IDX(idx) */
     740  (void)p_cellcb;   // to avoid unused warning
    714741
    715742        /* ここに処理本体を記述します #_TEFB_# */
     
    737764                return(E_ID);
    738765        }
     766  (void)p_cellcb;   // to avoid unused warning
    739767
    740768        /* ここに処理本体を記述します #_TEFB_# */
     
    757785                return(E_ID);
    758786        }
     787  (void)p_cellcb;   // to avoid unused warning
    759788
    760789        /* ここに処理本体を記述します #_TEFB_# */
     
    778807                return(E_ID);
    779808        }
     809  (void)p_cellcb;   // to avoid unused warning
    780810
    781811        /* ここに処理本体を記述します #_TEFB_# */
     
    800830                return(E_ID);
    801831        }
     832  (void)p_cellcb;   // to avoid unused warning
    802833
    803834        /* ここに処理本体を記述します #_TEFB_# */
     
    821852                return(E_ID);
    822853        }
     854  (void)p_cellcb;   // to avoid unused warning
    823855
    824856        /* ここに処理本体を記述します #_TEFB_# */
     
    863895                return(E_ID);
    864896        } /* end if VALID_IDX(idx) */
     897  (void)p_cellcb;   // to avoid unused warning
    865898
    866899        /* ここに処理本体を記述します #_TEFB_# */
     
    883916                return(E_ID);
    884917        }
     918  (void)p_cellcb;   // to avoid unused warning
    885919
    886920        /* ここに処理本体を記述します #_TEFB_# */
     
    903937                return(E_ID);
    904938        }
     939  (void)p_cellcb;   // to avoid unused warning
    905940
    906941        /* ここに処理本体を記述します #_TEFB_# */
     
    923958                return(E_ID);
    924959        }
     960  (void)p_cellcb;   // to avoid unused warning
    925961
    926962        /* ここに処理本体を記述します #_TEFB_# */
     
    944980                return(E_ID);
    945981        } /* end if VALID_IDX(idx) */
     982  (void)p_cellcb;   // to avoid unused warning
    946983
    947984        /* ここに処理本体を記述します #_TEFB_# */
     
    9661003                return(E_ID);
    9671004        }
     1005  (void)p_cellcb;   // to avoid unused warning
    9681006
    9691007        /* ここに処理本体を記述します #_TEFB_# */
     
    9881026                return(E_ID);
    9891027        }
     1028  (void)p_cellcb;   // to avoid unused warning
    9901029
    9911030        /* ここに処理本体を記述します #_TEFB_# */
     
    10101049                return(E_ID);
    10111050        }
     1051  (void)p_cellcb;   // to avoid unused warning
    10121052
    10131053        /* ここに処理本体を記述します #_TEFB_# */
     
    10311071                return(E_ID);
    10321072        } /* end if VALID_IDX(idx) */
     1073  (void)p_cellcb;   // to avoid unused warning
    10331074
    10341075        /* ここに処理本体を記述します #_TEFB_# */
     
    10511092                return(E_ID);
    10521093        } /* end if VALID_IDX(idx) */
     1094  (void)p_cellcb;   // to avoid unused warning
    10531095
    10541096        /* ここに処理本体を記述します #_TEFB_# */
     
    10711113                return(E_ID);
    10721114        } /* end if VALID_IDX(idx) */
     1115  (void)p_cellcb;   // to avoid unused warning
    10731116
    10741117        /* ここに処理本体を記述します #_TEFB_# */
     
    10911134                return(E_ID);
    10921135        } /* end if VALID_IDX(idx) */
     1136  (void)p_cellcb;   // to avoid unused warning
    10931137
    10941138        /* ここに処理本体を記述します #_TEFB_# */
     
    11121156                return(E_ID);
    11131157        } /* end if VALID_IDX(idx) */
     1158  (void)p_cellcb;   // to avoid unused warning
    11141159
    11151160        /* ここに処理本体を記述します #_TEFB_# */
     
    11341179                return(E_ID);
    11351180        } /* end if VALID_IDX(idx) */
     1181  (void)p_cellcb;   // to avoid unused warning
    11361182
    11371183        /* ここに処理本体を記述します #_TEFB_# */
     
    11561202                return(E_ID);
    11571203        } /* end if VALID_IDX(idx) */
     1204  (void)p_cellcb;   // to avoid unused warning
    11581205
    11591206        /* ここに処理本体を記述します #_TEFB_# */
     
    11781225                return(E_ID);
    11791226        } /* end if VALID_IDX(idx) */
     1227  (void)p_cellcb;   // to avoid unused warning
    11801228
    11811229        /* ここに処理本体を記述します #_TEFB_# */
     
    11991247                return(E_ID);
    12001248        }
     1249  (void)p_cellcb;   // to avoid unused warning
    12011250
    12021251        /* ここに処理本体を記述します #_TEFB_# */
     
    12201269                return(E_ID);
    12211270        }
     1271  (void)p_cellcb;   // to avoid unused warning
    12221272
    12231273        /* ここに処理本体を記述します #_TEFB_# */
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecsgen.rb

    r359 r374  
    55#      Generator for TOPPERS Embedded Component System
    66
    7 #   Copyright (C) 2008-2017 by TOPPERS Project
     7#   Copyright (C) 2008-2019 by TOPPERS Project
    88#--
    99#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    5454#  Authors list is in i-ro-ha order.
    5555#Version::   see version.rb
    56 $Copyright = "Copyright(c) 2008-2017, TOPPERS project. All rights reserved."
     56$Copyright = "Copyright(c) 2008-2019, TOPPERS project. All rights reserved."
    5757$License   = "TOPPERS License"
    5858
     
    223223    analyze_option addtional_option_parser
    224224    load_modules
    225     setup
     225    if ! $TECSFLOW then
     226      setup
     227    end
    226228       
    227229    dbgPrint  "tecspath: #{$tecsgen_base_path}, __FILE__=#{__FILE__}\n"
     
    284286    ARGV.each { |a| $arguments += " " + a }
    285287
    286     $unopt     = false     # bool:   disable optimizing
     288    $unopt     = false     # bool:   disable optimizing both call and entry port
     289    $unopt_entry= false    # bool:   disable optimizing entry port
    287290    $gen_base  = "gen"     # string: folder path to place generated files
    288291    $gen       = $gen_base # string: folder path to place generated files
     
    385388        $unopt = true
    386389      }
     390      parser.on('--unoptimize-entry', 'unoptimize entry port') {
     391        $unopt_entry = true
     392      }
    387393      parser.on('-c', '--cpp=cpp_cmd', 'C pre-processor command used import_C (default: gcc -E -DTECSGEN), you can also specify by environment variable TECS_CPP' ){
    388394        |arg|
     
    465471    }
    466472
    467     if ARGV.empty? && ! $print_version && ! $unit_test
     473    if ARGV.empty? && ! $print_version && ! $unit_test && ! $TECSFLOW
    468474      ARGV.options{|parser|
    469475        puts parser.help
     
    482488    # このファイルを誤って読み込むと、異なるバージョン名を表示してしまう
    483489    require_tecsgen_lib 'tecslib/version.rb'
    484     if $tecscde_version then
    485       STDERR << "tecscde version #{$tecscde_version} (tecsgen version #{$version})  #{$Copyright}\n"
     490    if $title then
     491      STDERR << "#{$title} version #{$tool_version} (tecsgen version #{$version})  #{$Copyright}\n"
    486492    elsif ! $no_banner || $print_version
    487493      STDERR << "tecsgen  version #{$version}  #{$Copyright}\n"
     
    490496      STDERR << "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE} patchlevel #{RUBY_PATCHLEVEL}) [#{RUBY_PLATFORM}]\n"
    491497    end
    492     if $print_version && ARGV.empty?
     498    if $print_version && ARGV.empty? && ! $TECSFLOW
    493499      exit
    494500    end
     
    518524    require_tecsgen_lib 'tecslib/core/tool_info.rb'
    519525    require_tecsgen_lib 'tecslib/core/tecsinfo.rb'
     526    require_tecsgen_lib 'tecslib/core/unjoin_plugin.rb'
    520527    require_tecsgen_lib 'tecslib/plugin/CelltypePlugin.rb'
    521528    require_tecsgen_lib 'tecslib/plugin/CompositePlugin.rb'
     
    601608#  クラス変数のリセットを確実に行う必要がある
    602609
    603 if $TECSCDE != true then
     610if $TECSCDE != true && $TECSFLOW != true then
    604611  begin
    605612    TECSGEN.init
     
    607614    tecsgen.run1
    608615    tecsgen.run2
     616    tecsgen.dump_tecsgen_rbdmp
    609617  rescue => evar
    610618    print_exception( evar )
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecsgen_rcov.rb

    r337 r374  
    4444# Usage: tecsgen_rcov.rb [options] CDL-file.cdl
    4545#
     46
     47$:.unshift(File.dirname(__FILE__))
     48
    4649require 'simplecov'
    47 SimpleCov.command_name "tecsgen#{$$}"
     50SimpleCov.command_name "tecsgen#{Time.now.to_f}"
    4851SimpleCov.root File.dirname( File.expand_path __FILE__ )
    4952SimpleCov.at_exit do
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/C_parser.tab.rb

    r337 r374  
    11#
    22# DO NOT MODIFY!!!!
    3 # This file is automatically generated by Racc 1.4.14
     3# This file is automatically generated by Racc 1.4.9
    44# from Racc grammer file "".
    55#
     
    88class C_parser < Racc::Parser
    99
    10 module_eval(<<'...end C_parser.y.rb/module_eval...', 'C_parser.y.rb', 727)
    11 
    12   RESERVED = {
    13     # keyword
    14     'typedef' => :TYPEDEF,
    15     'struct' => :STRUCT,
    16     'union' => :UNION,
    17     'sizeof' => :SIZEOF,
    18     'throw' => :THROW,
    19 
    20     # specifier
    21     # types
    22     'void'    => :VOID,
    23     'char'    => :CHAR,
    24     'short'   => :SHORT,
    25 
    26     'volatile'=> :VOLATILE,
    27     'const'   => :CONST,
    28     'extern'   => :EXTERN,
    29 
    30     'long'    => :LONG,
    31     'float'   => :FLOAT,
    32     'double'  => :DOUBLE,
    33     'signed'  => :SIGNED,
    34     'unsigned'=> :UNSIGNED,
    35 
    36     'int'     => :INT,
    37     'enum'    => :ENUM,
    38 
    39     'if'      => :IF,
    40     'else'    => :ELSE,
    41     'while'   => :WHILE,
    42     'do'      => :DO,
    43     'for'     => :FOR,
    44     'case'    => :CASE,
    45     'default' => :DEFAULT,
    46     'goto'    => :GOTO,
    47     'continue' => :CONTINUE,
    48     'break'   => :BREAK,
    49     'return'  => :RETURN,
    50     '__inline__'  => :__INLINE__,
    51     'inline'  => :INLINE,
    52     '__inline'  => :__INLINE,
    53     'Inline'  => :CINLINE,        # inline starting with Capital letter
    54     'static'  => :STATIC,
    55     'register' => :REGISTER,
    56     'auto'    => :AUTO,
    57     '__extension__'    => :EXTENSION,
    58 
    59   }
    60 
    61   @@generator_nest = -1
    62   @@generator_stack = []
    63   @@current_locale = []
    64 
    65   def finalize
    66 
    67     # mikan Namespace.pop
    68     Celltype.pop
    69     Cell.pop
    70     CompositeCelltype.pop
    71     Region.pop
    72 
    73   end
    74 
    75   def set_plugin( plugin )
    76     @plugin = plugin
    77   end
    78 
    79   def self.get_plugin
    80     @@generator_stack[@@generator_nest].get_plugin
    81   end
    82 
    83   def get_plugin
    84     @plugin
    85   end
    86 
    87   def parse(files)
    88 
    89     # mikan Namespace.push
    90     Celltype.push
    91     Cell.push
    92     CompositeCelltype.push
    93     Region.push
    94 
    95     @@generator_nest += 1
    96     @@generator_stack[@@generator_nest] = self
    97     @b_no_type_name = false
    98 
    99    begin
    100 
    101     @q = []
    102     comment = false
    103 
    104     # euc のコメントを utf8 として扱うと、コメントの終わりを誤る問題の対策
    105     TECS_LANG::set_kcode_binary
    106 
    107     # 800U, 0xffLL など (整数リテラルに共通の修飾子)
    108     integer_qualifier = "([Uu][Ll][Ll]|[Uu][Ll]|[Uu]|[Ll][Ll]|[Ll])?"
    109 
    110     files.each {|file|
    111       lineno = 1
    112      begin
    113 #2.0       IO.foreach(file) {|line|
    114        TECSIO.foreach(file) {|line|
    115         col = 1
    116         line.rstrip!
    117 
    118         until line.empty?
    119 
    120           if comment
    121             case line
    122             # コメント終了
    123             when /\A\*\//
    124               comment = false
    125             when /\A./
    126               ;
    127             end
    128           else
    129             case line
    130             # 空白、プリプロセスディレクティブ
    131             when /\A\s+/
    132               ;
    133             # 識別子
    134             when /\A[a-zA-Z_]\w*/
    135               word = $&
    136               @q << [RESERVED[word] || :IDENTIFIER, Token.new(word.intern, file, lineno, col)]
    137             # 16 進数定数
    138             when /\A0x[0-9A-Fa-f]+#{integer_qualifier}/
    139               @q << [:HEX_CONSTANT, Token.new($&, file, lineno, col)]
    140             # 8 進数定数
    141             when /\A0[0-7]+#{integer_qualifier}/
    142               @q << [:OCTAL_CONSTANT, Token.new($&, file, lineno, col)]
    143             # 浮動小数定数
    144             when /\A[0-9]+\.([0-9]*)?([Ee][+-]?[0-9]+)?/
    145               @q << [:FLOATING_CONSTANT, Token.new($&, file, lineno, col)]
    146             # 整数定数
    147             when /\A\d+#{integer_qualifier}/
    148             # when /\A\d+/
    149               @q << [:INTEGER_CONSTANT, Token.new($&.to_i, file, lineno, col)]
    150             # 文字
    151             when /\A'(?:[^'\\]|\\.)'/
    152               @q << [:CHARACTER_LITERAL, Token.new($&, file, lineno, col)]
    153             # 文字列
    154 #              "#include  #include #include \"../systask/logtask.cfg\"       最後の " 忘れ)で無限ループ
    155 #            when /\A"(?:[^"\\]+|\\.)*"/
    156             when /\A"(?:[^"\\]|\\.)*"/   # これはうまく行くようだ
    157               @q << [:STRING_LITERAL, Token.new($&, file, lineno, col)]
    158             # 行コメント
    159             when /\A\/\/.*$/
    160               # 読み飛ばすだけ
    161             # コメント開始
    162             when /\A\/\*/
    163               comment = true
    164             when /\A>>=/, /\A<<=/, /\A>>/,  /\A<</
    165               @q << [$&, Token.new($&, file, lineno, col)]
    166             when /\A\+=/, /\A\-=/, /\A\*=/, /\A\/=/, /\A%=/, /\A&=/, /\A\|=/, /\A\^=/
    167               @q << [$&, Token.new($&, file, lineno, col)]
    168             when /\A::/, /\A==/, /\A!=/, /\A>=/, /\A<=/, /\A\->/, /\A\+\+/, /\A\-\-/
    169               @q << [$&, Token.new($&, file, lineno, col)]
    170             when /\A./
    171               @q << [$&, Token.new($&, file, lineno, col)]
    172             else
    173               raise
    174             end
    175           end
    176 
    177           line = $'
    178           col += $&.length
    179         end
    180 
    181         lineno += 1
    182       }
    183 
    184      rescue => evar
    185        Generator.error( "B1002 while open or reading \'$1\'" , file )
    186        print_exception( evar )
    187      end
    188     }
    189 
    190     # 終了の印
    191     @q << nil
    192 
    193     @yydebug = true
    194     do_parse
    195 
    196    ensure
    197     @@generator_nest -= 1
    198     TECS_LANG::reset_kcode
    199    end
    200 
    201   end
    202 
    203 
    204   def next_token
    205     token = @q.shift
    206 
    207     if token then
    208       @@current_locale[@@generator_nest] = token[1].locale
    209 
    210       case token[1].val
    211       when ";", ":", ",", "(", ")", "{", "}"
    212         set_no_type_name false
    213       when ".", "->"
    214         set_no_type_name true
    215       end
    216 
    217       # TYPE_NAME トークンへ置き換え
    218       if @b_no_type_name == false
    219         if token[0] == :IDENTIFIER && Namespace.is_typename?( token[1].val ) then
    220           token[0] = :TYPE_NAME
    221           locale = @@current_locale[@@generator_nest]
     10module_eval(<<'...end C_parser.y.rb/module_eval...', 'C_parser.y.rb', 784)
     11
     12        RESERVED = {
     13                # keyword
     14                'typedef' => :TYPEDEF,
     15                'struct' => :STRUCT,
     16                'union' => :UNION,
     17                'sizeof' => :SIZEOF,
     18                'throw' => :THROW,
     19
     20                # specifier
     21                # types
     22                'void'    => :VOID,
     23                'char'    => :CHAR,
     24                'short'   => :SHORT,
     25
     26                'volatile'=> :VOLATILE,
     27                'restrict'=> :RESTRICT,
     28                'const'   => :CONST,
     29                'extern'   => :EXTERN,
     30
     31                'long'    => :LONG,
     32                'float'   => :FLOAT,
     33                'double'  => :DOUBLE,
     34                'signed'  => :SIGNED,
     35                'unsigned'=> :UNSIGNED,
     36
     37                'int'     => :INT,
     38                'enum'    => :ENUM,
     39
     40                'if'      => :IF,
     41                'else'    => :ELSE,
     42                'while'   => :WHILE,
     43                'do'      => :DO,
     44                'for'     => :FOR,
     45                'switch'  => :SWITCH,
     46                'case'    => :CASE,
     47                'default' => :DEFAULT,
     48                'goto'    => :GOTO,
     49                'continue' => :CONTINUE,
     50                'break'   => :BREAK,
     51                'return'  => :RETURN,
     52                '__inline__'  => :__INLINE__,
     53                'inline'  => :INLINE,
     54                '__inline'  => :__INLINE,
     55                'Inline'  => :CINLINE,        # inline starting with Capital letter
     56                'static'  => :STATIC,
     57                'register' => :REGISTER,
     58                'auto'    => :AUTO,
     59                '__extension__'    => :EXTENSION,
     60                '__asm__' => :_ASM,
     61                'asm' =>     :_ASM
     62
     63        }
     64
     65        @@generator_nest = -1
     66        @@generator_stack = []
     67        @@current_locale = []
     68
     69        def finalize
     70
     71                # mikan Namespace.pop
     72                Celltype.pop
     73                Cell.pop
     74                CompositeCelltype.pop
     75                Region.pop
     76
     77        end
     78
     79        def set_plugin( plugin )
     80                @plugin = plugin
     81        end
     82
     83        def self.get_plugin
     84                @@generator_stack[@@generator_nest].get_plugin
     85        end
     86
     87        def get_plugin
     88                @plugin
     89        end
     90
     91        def parse(files)
     92
     93                # mikan Namespace.push
     94                Celltype.push
     95                Cell.push
     96                CompositeCelltype.push
     97                Region.push
     98
     99                @@generator_nest += 1
     100                @@generator_stack[@@generator_nest] = self
     101                @b_no_type_name = false
     102
     103        begin
     104
     105                @q = []
     106                comment = false
     107#               b_asm   = false
     108
     109                # euc のコメントを utf8 として扱うと、コメントの終わりを誤る問題の対策
     110                TECS_LANG::set_kcode_binary
     111
     112                # 800U, 0xffLL など (整数リテラルに共通の修飾子)
     113                integer_qualifier = "([Uu][Ll][Ll]|[Uu][Ll]|[Uu]|[Ll][Ll]|[Ll])?"
     114
     115                files.each {|file|
     116                        lineno = 1
     117                begin
     118#2.0            IO.foreach(file) {|line|
     119                        TECSIO.foreach(file) {|line|
     120                        col = 1
     121                        line.rstrip!
     122
     123                        until line.empty?
     124
     125                                if comment
     126                                        case line
     127                                        # コメント終了
     128                                        when /\A\*\//
     129                                                comment = false
     130                                        when /\A./
     131                                                ;
     132                                        end
     133                                else
     134                                        case line
     135                                        # 空白、プリプロセスディレクティブ
     136                                        when /\A\s+/
     137                                                ;
     138                                        # 識別子
     139                                        when /\A[a-zA-Z_]\w*/
     140                                                word = $&
     141                                                @q << [RESERVED[word] || :IDENTIFIER, Token.new(word.intern, file, lineno, col)]
     142                                        # 16 進数定数
     143                                        when /\A0x[0-9A-Fa-f]+#{integer_qualifier}/
     144                                                @q << [:HEX_CONSTANT, Token.new($&, file, lineno, col)]
     145                                        # 8 進数定数
     146                                        when /\A0[0-7]+#{integer_qualifier}/
     147                                                @q << [:OCTAL_CONSTANT, Token.new($&, file, lineno, col)]
     148                                        # 浮動小数定数
     149                                        when /\A[0-9]+\.([0-9]*)?([Ee][+-]?[0-9]+)?/
     150                                                @q << [:FLOATING_CONSTANT, Token.new($&, file, lineno, col)]
     151                                        # 整数定数
     152                                        when /\A\d+#{integer_qualifier}/
     153                                        # when /\A\d+/
     154                                                @q << [:INTEGER_CONSTANT, Token.new($&.to_i, file, lineno, col)]
     155                                        # 文字
     156                                        when /\A'(?:[^'\\]|\\.)'/
     157                                                @q << [:CHARACTER_LITERAL, Token.new($&, file, lineno, col)]
     158                                        # 文字列
     159#                                       "#include  #include #include \"../systask/logtask.cfg\"       最後の " 忘れ)で無限ループ
     160#                                       when /\A"(?:[^"\\]+|\\.)*"/
     161                                        when /\A"(?:[^"\\]|\\.)*"/   # これはうまく行くようだ
     162                                                @q << [:STRING_LITERAL, Token.new($&, file, lineno, col)]
     163                                        # 行コメント
     164                                        when /\A\/\/.*$/
     165                                                # 読み飛ばすだけ
     166                                        # コメント開始
     167                                        when /\A\/\*/
     168                                                comment = true
     169                                        when /\A>>=/, /\A<<=/, /\A>>/,  /\A<</
     170                                                @q << [$&, Token.new($&, file, lineno, col)]
     171                                        when /\A\+=/, /\A\-=/, /\A\*=/, /\A\/=/, /\A%=/, /\A&=/, /\A\|=/, /\A\^=/
     172                                                @q << [$&, Token.new($&, file, lineno, col)]
     173                                        when /\A::/, /\A==/, /\A!=/, /\A>=/, /\A<=/, /\A\->/, /\A\+\+/, /\A\-\-/
     174                                                @q << [$&, Token.new($&, file, lineno, col)]
     175                                        when /\A\|\|/, /\A\&\&/
     176                                                @q << [$&, Token.new($&, file, lineno, col)]
     177                                        when /\A./
     178                                                @q << [$&, Token.new($&, file, lineno, col)]
     179                                        else
     180                                                raise
     181                                        end
     182                                end
     183
     184                                line = $'
     185                                col += $&.length
     186                        end
     187
     188                        lineno += 1
     189                }
     190
     191                rescue => evar
     192                        Generator.error( "B1002 while open or reading \'$1\'" , file )
     193                        print_exception( evar )
     194                end
     195        }
     196
     197        # 終了の印
     198        @q << nil
     199
     200        @yydebug = true
     201        do_parse
     202
     203                ensure
     204                        @@generator_nest -= 1
     205                        TECS_LANG::reset_kcode
     206                end
     207
     208        end
     209
     210
     211        def next_token
     212                token = @q.shift
     213
     214                if token then
     215                        @@current_locale[@@generator_nest] = token[1].locale
     216
     217                        case token[1].val
     218                        when ";", ":", ",", "(", ")", "{", "}"
     219                        set_no_type_name false
     220                        when ".", "->"
     221                        set_no_type_name true
     222                        end
     223
     224                        # TYPE_NAME トークンへ置き換え
     225                        if @b_no_type_name == false
     226                                if token[0] == :IDENTIFIER && Namespace.is_typename?( token[1].val ) then
     227                                        token[0] = :TYPE_NAME
     228                                        locale = @@current_locale[@@generator_nest]
    222229#print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}: type_name'\n" )
    223         end
    224       end
    225 
    226       if $debug then     # 070107 token 無効時ここを通さないようした (through 対応 -d の時に例外発生)
    227         locale = @@current_locale[@@generator_nest]
    228         if token then
    229           print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}'\n" )
    230         else
    231           print( "#{locale[0]}: line #{locale[1]} : EOF\n" )
    232         end
    233       end
    234     end
    235 
    236     token
    237   end
    238 
    239   def on_error(t, v, vstack)
    240     if v == "$" then
    241      Generator.error( "B1003 Unexpected EOF"  )
    242     else
    243      Generator.error( "B1004 syntax error near \'$1\'" , v.val )
    244     end
    245 
    246   end
    247 
    248   def self.current_locale
    249     @@current_locale[ @@generator_nest ]
    250   end
    251 
    252   @@n_error = 0
    253   @@n_warning = 0
    254   @@n_info = 0
    255 
    256   # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でエラー発生は不適切)
    257   def self.error( msg )
    258     @@n_error += 1
    259     locale = @@current_locale[ @@generator_nest ]
    260 
    261     if locale then
    262       Console.puts "error: #{locale[0]}: line #{locale[1]} #{msg}"
    263     else
    264       Console.puts "error: #{msg}"
    265     end
    266   end
    267 
    268   # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でウォーニング発生は不適切)
    269   def self.warning( msg )
    270     @@n_warning += 1
    271     locale = @@current_locale[ @@generator_nest ]
    272     Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}"
    273   end
    274 
    275   # このメソッドは構文解析、意味解析からのみ呼出し可
    276   def self.info( msg )
    277     @@n_info += 1
    278     locale = @@current_locale[ @@generator_nest ]
    279     Console.puts "info: #{locale[0]}: line #{locale[1]} #{msg}"
    280   end
    281 
    282   def self.get_n_error
    283     @@n_error
    284   end
    285 
    286   def self.get_n_warning
    287     @@n_warning
    288   end
    289 
    290   def self.get_nest
    291     @@generator_nest
    292   end
    293 
    294   def set_no_type_name b_no_type_name
    295     locale = @@current_locale[ @@generator_nest ]
     230                                end
     231                        end
     232
     233                        if $debug then     # 070107 token 無効時ここを通さないようした (through 対応 -d の時に例外発生)
     234                                locale = @@current_locale[@@generator_nest]
     235                                if token then
     236                                        print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}'\n" )
     237                                else
     238                                        print( "#{locale[0]}: line #{locale[1]} : EOF\n" )
     239                                end
     240                        end
     241                end
     242
     243                token
     244        end
     245
     246        def on_error(t, v, vstack)
     247                if v == "$" then
     248                        Generator.error( "B1003 Unexpected EOF"  )
     249                else
     250                        Generator.error( "B1004 syntax error near \'$1\'" , v.val )
     251                end
     252
     253        end
     254
     255        def self.current_locale
     256                @@current_locale[ @@generator_nest ]
     257        end
     258
     259        @@n_error = 0
     260        @@n_warning = 0
     261        @@n_info = 0
     262
     263        # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でエラー発生は不適切)
     264        def self.error( msg )
     265                @@n_error += 1
     266                locale = @@current_locale[ @@generator_nest ]
     267
     268                if locale then
     269                        Console.puts "#{locale[0]}:#{locale[1]}: error: #{msg}"
     270                else
     271                        Console.puts "error: #{msg}"
     272                end
     273        end
     274
     275        # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でウォーニング発生は不適切)
     276        def self.warning( msg )
     277                @@n_warning += 1
     278                locale = @@current_locale[ @@generator_nest ]
     279                Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}"
     280        end
     281
     282        # このメソッドは構文解析、意味解析からのみ呼出し可
     283        def self.info( msg )
     284                @@n_info += 1
     285                locale = @@current_locale[ @@generator_nest ]
     286                Console.puts "info: #{locale[0]}: line #{locale[1]} #{msg}"
     287        end
     288
     289        def self.get_n_error
     290                @@n_error
     291        end
     292
     293        def self.get_n_warning
     294                @@n_warning
     295        end
     296
     297        def self.get_nest
     298                @@generator_nest
     299        end
     300
     301        def set_no_type_name b_no_type_name
     302                locale = @@current_locale[ @@generator_nest ]
    296303#print "b_no_type_name=#{b_no_type_name} #{locale[0]}: line #{locale[1]}\n"
    297     @b_no_type_name = b_no_type_name
    298   end
     304                @b_no_type_name = b_no_type_name
     305        end
    299306
    300307...end C_parser.y.rb/module_eval...
     
    302309
    303310clist = [
    304 '106,107,108,109,110,112,70,113,68,181,302,143,55,118,119,208,117,120',
    305 '121,122,123,124,125,106,107,108,109,110,112,337,113,209,336,210,143',
    306 '76,118,119,170,117,120,121,122,123,124,125,305,69,301,67,350,28,29,106',
    307 '107,108,109,110,112,75,113,28,29,162,143,77,118,119,170,117,120,121',
    308 '122,123,124,125,169,79,205,206,353,306,307,308,309,310,311,312,313,314',
    309 '315,264,55,144,8,9,10,11,15,16,17,18,19,20,21,174,267,23,25,27,28,29',
    310 '197,198,375,263,144,106,107,108,109,110,112,346,113,342,197,198,143',
    311 '173,118,119,153,117,120,121,122,123,124,125,106,107,108,109,110,112',
    312 '144,113,357,341,3,143,274,118,119,253,117,120,121,122,123,124,125,106',
    313 '107,108,109,110,112,54,113,199,200,361,143,53,118,119,98,117,120,121',
    314 '122,123,124,125,106,107,108,109,110,112,345,113,363,83,364,143,82,118',
    315 '119,346,117,120,121,122,123,124,125,81,144,249,83,274,253,82,253,53',
    316 '106,107,108,109,110,112,337,113,55,336,365,236,366,118,119,144,117,120',
    317 '121,122,123,124,125,54,249,367,194,253,97,53,53,195,196,81,199,200,55',
    318 '55,144,230,89,8,9,10,11,15,16,17,18,19,20,21,79,372,23,25,27,28,29,199',
    319 '200,144,231,88,232,233,234,235,87,237,238,240,241,242,243,194,377,194',
    320 '199,200,195,196,195,196,378,39,40,41,42,43,44,45,46,144,106,107,108',
    321 '109,110,112,379,113,205,206,380,143,381,118,119,382,117,120,121,122',
    322 '123,124,125,106,107,108,109,110,112,384,113,197,198,385,143,386,118',
    323 '119,65,117,120,121,122,123,124,125,106,107,108,109,110,112,62,113,391',
    324 '37,392,143,393,118,119,394,117,120,121,122,123,124,125,106,107,108,109',
    325 '110,112,61,113,211,212,396,143,398,118,119,280,117,120,121,122,123,124',
    326 '125,47,144,279,36,277,8,9,10,11,15,16,17,18,19,20,21,271,37,23,25,27',
    327 '28,29,270,144,38,8,9,10,11,15,16,17,18,19,20,21,199,200,23,25,27,28',
    328 '29,269,97,256,144,255,39,40,41,42,43,44,45,46,36,247,8,9,10,11,15,16',
    329 '17,18,19,20,21,144,246,23,25,27,28,29,245,32,38,106,107,108,109,110',
    330 '112,216,113,215,210,209,143,208,118,119,207,117,120,121,122,123,124',
    331 '125,39,40,41,42,43,44,45,46,303,106,107,108,109,110,112,316,113,317',
    332 '319,320,236,321,118,119,323,117,120,121,122,123,124,125,54,54,54,324',
    333 '54,325,53,53,53,326,53,329,176,55,55,55,230,55,8,9,10,11,15,16,17,18',
    334 '19,20,21,79,175,23,25,27,28,29,77,97,144,231,171,232,233,234,235,163',
    335 '237,238,240,241,242,243,183,348,184,349,185,186,187,207,,,39,40,41,42',
    336 '43,44,45,46,144,106,107,108,109,110,112,,113,,,,143,,118,119,,117,120',
    337 '121,122,123,124,125,,,106,107,108,109,110,112,,113,,,,236,,118,119,',
    338 '117,120,121,122,123,124,125,54,54,54,,54,,53,53,53,,53,,,55,55,55,230',
    339 '55,8,9,10,11,15,16,17,18,19,20,21,79,,23,25,27,28,29,,,,231,,232,233',
    340 '234,235,144,237,238,240,241,242,243,201,202,203,204,201,202,203,204',
    341 ',,39,40,41,42,43,44,45,46,144,106,107,108,109,110,112,,113,,,,236,,118',
    342 '119,,117,120,121,122,123,124,125,54,201,202,203,204,,53,,,,,,,55,,,230',
    343 ',8,9,10,11,15,16,17,18,19,20,21,79,,23,25,27,28,29,,,,231,,232,233,234',
    344 '235,,237,238,240,241,242,243,,,,,,,,,,,39,40,41,42,43,44,45,46,144,106',
    345 '107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124,125',
    346 '106,107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124',
    347 '125,106,107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123',
    348 '124,125,106,107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122',
    349 '123,124,125,,144,,,,,,,,106,107,108,109,110,112,,113,,,,143,,118,119',
    350 '144,117,120,121,122,123,124,125,106,107,108,109,110,112,,113,,368,,143',
    351 ',118,119,144,117,120,121,122,123,124,125,,,,,,,,106,107,108,109,110',
    352 '112,,113,144,,,236,,118,119,,117,120,121,122,123,124,125,,,,,,,,,,,',
    353 ',,,,,230,144,8,9,10,11,15,16,17,18,19,20,21,79,,23,25,27,28,29,,,,231',
    354 '144,232,233,234,235,,237,238,240,241,242,243,,,,,,,,,,,39,40,41,42,43',
    355 '44,45,46,144,106,107,108,109,110,112,,113,,,,236,,118,119,,117,120,121',
    356 '122,123,124,125,,,,,,,,,,,,,,,,,230,,8,9,10,11,15,16,17,18,19,20,21',
    357 '79,,23,25,27,28,29,,,,231,,232,233,234,235,,237,238,240,241,242,243',
    358 ',,,,,,,,,,39,40,41,42,43,44,45,46,144,106,107,108,109,110,112,,113,',
    359 ',,236,,118,119,,117,120,121,122,123,124,125,,,,,,,,,,,,,,,,,230,,8,9',
    360 '10,11,15,16,17,18,19,20,21,79,,23,25,27,28,29,,,,231,,232,233,234,235',
    361 ',237,238,240,241,242,243,,,,,,,,,,,39,40,41,42,43,44,45,46,144,106,107',
    362 '108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124,125,106',
    363 '107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124,125',
    364 '106,107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124',
    365 '125,106,107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123',
    366 '124,125,,144,,,,,141,,,,,,,142,106,107,108,109,110,112,,113,,147,144',
    367 '143,,118,119,,117,120,121,122,123,124,125,106,107,108,109,110,112,,113',
    368 ',,144,143,,118,119,,117,120,121,122,123,124,125,106,107,108,109,110',
    369 '112,,113,,,144,143,,118,119,,117,120,121,122,123,124,125,106,107,108',
    370 '109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124,125,,144,',
    371 ',,,,,,106,107,108,109,110,112,,113,,,,143,,118,119,144,117,120,121,122',
    372 '123,124,125,106,107,108,109,110,112,,113,,,,143,,118,119,144,117,120',
    373 '121,122,123,124,125,106,107,108,109,110,112,,113,,,,143,,118,119,144',
    374 '117,120,121,122,123,124,125,106,107,108,109,110,112,,113,,,,143,,118',
    375 '119,,117,120,121,122,123,124,125,,144,,,,,141,351,,,,,,142,106,107,108',
    376 '109,110,112,,113,,,144,143,,118,119,,117,120,121,122,123,124,125,106',
    377 '107,108,109,110,112,,113,,,144,143,,118,119,,117,120,121,122,123,124',
    378 '125,106,107,108,109,110,112,,113,,,144,143,,118,119,,117,120,121,122',
    379 '123,124,125,106,107,108,109,110,112,,113,,,,143,,118,119,,117,120,121',
    380 '122,123,124,125,,144,,,,,,,,106,107,108,109,110,112,,113,,,,143,,118',
    381 '119,144,117,120,121,122,123,124,125,106,107,108,109,110,112,,113,,,',
    382 '143,,118,119,144,117,120,121,122,123,124,125,106,107,108,109,110,112',
    383 ',113,,,,143,,118,119,144,117,120,121,122,123,124,125,,,,,,,,,,106,107',
    384 '108,109,110,112,,113,,,,236,,118,119,144,117,120,121,122,123,124,125',
    385 ',,,,,,,,,,,,,,,144,230,,8,9,10,11,15,16,17,18,19,20,21,79,239,23,25',
    386 '27,28,29,,,144,231,,232,233,234,235,,237,238,240,241,242,243,,,,,,,',
    387 ',,,39,40,41,42,43,44,45,46,144,106,107,108,109,110,112,,113,,338,,143',
    388 ',118,119,,117,120,121,122,123,124,125,106,107,108,109,110,112,,113,',
    389 ',,143,,118,119,,117,120,121,122,123,124,125,8,9,10,11,15,16,17,18,19',
    390 '20,21,,,23,25,27,28,29,8,9,10,11,15,16,17,18,19,20,21,,,23,25,27,28',
    391 '29,,106,107,108,109,110,112,,113,,,144,143,,118,119,,117,120,121,122',
    392 '123,124,125,106,107,108,109,110,112,,113,,,144,143,,118,119,,117,120',
    393 '121,122,123,124,125,106,107,108,109,110,112,,113,,,,143,,118,119,,117',
    394 '120,121,122,123,124,125,106,107,108,109,110,189,,113,,,,143,,118,119',
    395 ',117,120,121,122,123,124,125,,144,,,,,,,,106,107,108,109,110,191,,113',
    396 ',,,143,,118,119,144,117,120,121,122,123,124,125,106,107,108,109,110',
    397 '191,,113,,,,143,,118,119,144,117,120,121,122,123,124,125,106,107,108',
    398 '109,110,112,,113,,,,143,,118,119,144,117,120,121,122,123,124,125,106',
    399 '107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124,125',
    400 ',144,,,,,141,,,,,,,142,,,328,,106,107,108,109,110,112,144,113,,,,143',
    401 ',118,119,,117,120,121,122,123,124,125,,,,,,,144,,,,,,,,,,,106,107,108',
    402 '109,110,112,,113,,,,236,144,118,119,,117,120,121,122,123,124,125,,,',
    403 ',,,,,,,,,,,,,230,,8,9,10,11,15,16,17,18,19,20,21,79,144,23,25,27,28',
    404 '29,,,,231,,232,233,234,235,,237,238,240,241,242,243,,,,,,,274,334,,253',
    405 '39,40,41,42,43,44,45,46,144,55,,,,,249,334,,253,,,53,,,,,,,55,,,,,8',
    406 '9,10,11,15,16,17,18,19,20,21,,,23,25,27,28,29,8,9,10,11,15,16,17,18',
    407 '19,20,21,,,23,25,27,28,29,370,,,,,,,,39,40,41,42,43,44,45,46,,,149,',
    408 ',,,,,,39,40,41,42,43,44,45,46,,8,9,10,11,15,16,17,18,19,20,21,,,23,25',
    409 '27,28,29,8,9,10,11,15,16,17,18,19,20,21,,,23,25,27,28,29,,,,330,,,,',
    410 '39,40,41,42,43,44,45,46,,,,,,,,,,,39,40,41,42,43,44,45,46,8,9,10,11',
    411 '15,16,17,18,19,20,21,,,23,25,27,28,29,8,9,10,11,15,16,17,18,19,20,21',
    412 ',,23,25,27,28,29,,,,,,,,,39,40,41,42,43,44,45,46,,,,,,,,,,,39,40,41',
    413 '42,43,44,45,46,8,9,10,11,15,16,17,18,19,20,21,,340,23,25,27,28,29,8',
    414 '9,10,11,15,16,17,18,19,20,21,,164,23,25,27,28,29,,,,,,,,,39,40,41,42',
    415 '43,44,45,46,,,,,,,,,,,39,40,41,42,43,44,45,46,8,9,10,11,15,16,17,18',
    416 '19,20,21,,,23,25,27,28,29,8,9,10,11,15,16,17,18,19,20,21,,,23,25,27',
    417 '28,29,,,,,,,,,39,40,41,42,43,44,45,46,,,,,,,,,,,39,40,41,42,43,44,45',
    418 '46,8,9,10,11,15,16,17,18,19,20,21,,,23,25,27,28,29,8,9,10,11,15,16,17',
    419 '18,19,20,21,,257,23,25,27,28,29,,,,,,,,,39,40,41,42,43,44,45,46,,,,',
    420 ',,,,,,39,40,41,42,43,44,45,46,8,9,10,11,15,16,17,18,19,20,21,,,23,25',
    421 '27,28,29,8,9,10,11,15,16,17,18,19,20,21,,262,23,25,27,28,29,,,,,,,,',
    422 '39,40,41,42,43,44,45,46,,,,,,,,,,,39,40,41,42,43,44,45,46,8,9,10,11',
    423 '15,16,17,18,19,20,21,,,23,25,27,28,29,8,9,10,11,15,16,17,18,19,20,21',
    424 ',,23,25,27,28,29,,,,,,,,,39,40,41,42,43,44,45,46,,,,,,,,,,,39,40,41',
    425 '42,43,44,45,46,8,9,10,11,15,16,17,18,19,20,21,,,23,25,27,28,29' ]
    426         racc_action_table = arr = ::Array.new(2875, nil)
     311'111,112,113,114,115,117,294,118,56,298,55,163,54,123,124,82,54,262,122',
     312'125,126,127,128,129,130,111,112,113,114,115,117,217,118,271,391,101',
     313'163,91,123,124,82,271,271,122,125,126,127,128,129,130,56,70,171,72,82',
     314'69,397,71,80,32,33,34,224,309,271,223,216,226,84,227,228,229,84,392',
     315'101,325,272,171,298,312,80,164,165,172,393,173,174,175,176,177,178,179',
     316'180,149,181,101,218,79,308,369,388,32,33,34,265,266,164,165,172,73,173',
     317'174,175,176,177,178,179,180,149,181,111,112,113,114,115,117,384,118',
     318'32,33,34,163,78,123,124,82,440,402,122,125,126,127,128,129,130,55,219',
     319'271,271,383,101,54,332,248,325,387,55,298,249,250,56,382,54,111,112',
     320'113,114,115,117,56,118,56,171,331,163,395,123,124,82,276,210,122,125',
     321'126,127,128,129,130,420,55,378,210,248,377,396,54,330,249,250,393,92',
     322'164,165,172,56,173,174,175,176,177,178,179,180,149,181,171,9,10,11,12',
     323'13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,355,356',
     324'213,164,165,172,204,173,174,175,176,177,178,179,180,149,181,111,112',
     325'113,114,115,117,404,118,93,378,203,163,377,123,124,82,193,271,122,125',
     326'126,127,128,129,130,111,112,113,114,115,117,290,118,101,86,55,163,85',
     327'123,124,82,54,291,122,125,126,127,128,129,130,56,357,171,13,14,15,16',
     328'17,18,19,20,21,22,26,28,30,31,32,33,34,248,86,322,438,85,249,250,171',
     329'434,435,370,164,165,172,271,173,174,175,176,177,178,179,180,149,181',
     330'259,260,261,321,255,256,257,258,315,316,262,164,165,172,271,173,174',
     331'175,176,177,178,179,180,149,181,111,112,113,114,115,117,403,118,317',
     332'318,263,163,264,123,124,82,320,271,122,125,126,127,128,129,130,13,14',
     333'15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,437,111,112,113,114,115',
     334'117,360,118,400,171,271,163,368,123,124,82,166,103,122,125,126,127,128',
     335'129,130,102,55,255,256,257,258,310,54,255,256,257,258,405,164,165,172',
     336'56,173,174,175,176,177,178,179,180,149,181,171,9,10,11,12,13,14,15,16',
     337'17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,259,260,301,164,165',
     338'172,300,173,174,175,176,177,178,179,180,149,181,111,112,113,114,115',
     339'117,408,118,253,254,292,163,409,123,124,82,253,254,122,125,126,127,128',
     340'129,130,111,112,113,114,115,117,410,118,253,254,55,163,289,123,124,82',
     341'54,288,122,125,126,127,128,129,130,56,415,171,13,14,15,16,17,18,19,20',
     342'21,22,26,28,30,31,32,33,34,253,254,253,254,251,252,261,171,211,212,285',
     343'164,165,172,284,173,174,175,176,177,178,179,180,149,181,237,238,239',
     344'240,241,242,243,244,245,246,247,164,165,172,283,173,174,175,176,177',
     345'178,179,180,149,181,111,112,113,114,115,117,282,118,251,252,389,163',
     346'389,123,124,82,251,252,122,125,126,127,128,129,130,111,112,113,114,115',
     347'117,101,118,67,82,55,163,64,123,124,82,54,63,122,125,126,127,128,129',
     348'130,56,55,171,55,55,294,280,54,298,54,54,54,279,430,431,432,56,433,56',
     349'56,56,365,436,278,263,275,264,171,273,270,48,164,165,172,444,173,174',
     350'175,176,177,178,179,180,149,181,269,3,,,,,,,,,,164,165,172,,173,174',
     351'175,176,177,178,179,180,149,181,111,112,113,114,115,117,,118,,,,163',
     352',123,124,82,,,122,125,126,127,128,129,130,111,112,113,114,115,117,,118',
     353',,,148,,123,124,,,,122,125,126,127,128,129,130,,,171,111,112,113,114',
     354'115,117,,118,,,,148,,123,124,,,,122,125,126,127,128,129,130,,,,164,165',
     355'172,,173,174,175,176,177,178,179,180,149,181,,,,,,,111,112,113,114,115',
     356'117,,118,,411,,148,,123,124,,,149,122,125,126,127,128,129,130,,,,111',
     357'112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129',
     358'130,111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126,127',
     359'128,129,130,,,171,,,,,,,,,,,,,149,,111,112,113,114,115,117,,118,,,171',
     360'148,,123,124,,,,122,125,126,127,128,129,130,,149,,,,,,,,111,112,113',
     361'114,115,117,,118,,,,148,,123,124,146,398,149,122,125,126,127,128,129',
     362'130,111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126,127',
     363'128,129,130,111,112,113,114,115,117,,118,,149,,148,,123,124,389,,,122',
     364'125,126,127,128,129,130,,,,147,,,111,112,113,114,115,117,,118,,,,148',
     365'149,123,124,,,,122,125,126,127,128,129,130,111,112,113,114,115,117,',
     366'118,,379,,148,149,123,124,,,,122,125,126,127,128,129,130,,,,,,,,,,,',
     367',149,,,,,111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126',
     368'127,128,129,130,,149,,,,,,,,,,,,,,,,,,,,,,,,,149,171,9,10,11,12,13,14',
     369'15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,111,112,113',
     370'114,115,117,,118,,,,148,,123,124,149,,,122,125,126,127,128,129,130,111',
     371'112,113,114,115,117,,118,,,,148,,123,124,146,,,122,125,126,127,128,129',
     372'130,111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126,127',
     373'128,129,130,,111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122',
     374'125,126,127,128,129,130,,,147,,,111,112,113,114,115,117,,118,,,,148',
     375'149,123,124,,,,122,125,126,127,128,129,130,111,112,113,114,115,117,',
     376'118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,,111,112,113,114',
     377'115,117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,111,112',
     378'113,114,115,117,,118,,,,148,,123,124,146,,149,122,125,126,127,128,129',
     379'130,111,112,113,114,115,117,427,118,,,,148,,123,124,,,149,122,125,126',
     380'127,128,129,130,,111,112,113,114,115,117,,118,,,,148,,123,124,,,149',
     381'122,125,126,127,128,129,130,,,147,,,111,112,113,114,115,117,,118,,185',
     382',148,149,123,124,,,,122,125,126,127,128,129,130,111,112,113,114,115',
     383'117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,,111,112',
     384'113,114,115,117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130',
     385'111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128',
     386'129,130,111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126',
     387'127,128,129,130,,111,112,113,114,115,117,,118,,,,148,,123,124,,,149',
     388'122,125,126,127,128,129,130,111,112,113,114,115,117,,118,,,,148,,123',
     389'124,,,149,122,125,126,127,128,129,130,111,112,113,114,115,117,,118,',
     390',,148,,123,124,,,149,122,125,126,127,128,129,130,,111,112,113,114,115',
     391'117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,111,112,113',
     392'114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,111',
     393'112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129',
     394'130,,111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126',
     395'127,128,129,130,111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122',
     396'125,126,127,128,129,130,111,112,113,114,115,117,,118,,,,148,,123,124',
     397',,149,122,125,126,127,128,129,130,,111,112,113,114,115,117,,118,,,,148',
     398',123,124,,,149,122,125,126,127,128,129,130,111,112,113,114,115,117,',
     399'118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,111,112,113,114',
     400'115,117,,118,,,,148,,123,124,146,,149,122,125,126,127,128,129,130,,111',
     401'112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129',
     402'130,,,,,,,,,,,,,,,,,,149,,,,,,,,,,147,,,111,112,113,114,115,117,,118',
     403',,,148,149,123,124,,,,122,125,126,127,128,129,130,,111,112,113,114,115',
     404'117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,,,,,,,13',
     405'14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,,,111,112,113,114,115',
     406'117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,,111,112',
     407'113,114,115,231,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130',
     408'111,112,113,114,115,233,,118,,,,148,,123,124,,,,122,125,126,127,128',
     409'129,130,111,112,113,114,115,233,,118,,,,148,,123,124,,,149,122,125,126',
     410'127,128,129,130,,,,,,,,,,,,,111,112,113,114,115,117,149,118,,,,148,',
     411'123,124,,,,122,125,126,127,128,129,130,111,112,113,114,115,117,149,118',
     412',,,148,,123,124,,,,122,125,126,127,128,129,130,,,,,,,149,13,14,15,16',
     413'17,18,19,20,21,22,26,28,30,31,32,33,34,,,111,112,113,114,115,117,,118',
     414',,,148,,123,124,,,149,122,125,126,127,128,129,130,111,112,113,114,115',
     415'117,327,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,,,,,,',
     416',13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,,,111,112,113,114',
     417'115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,111,112',
     418'113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130',
     419'111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126,127,128',
     420'129,130,,111,112,113,114,115,117,429,118,,,,148,,123,124,,,149,122,125',
     421'126,127,128,129,130,,287,,,,111,112,113,114,115,117,,118,,,,148,149',
     422'123,124,146,442,,122,125,126,127,128,129,130,111,112,113,114,115,117',
     423',118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,,111,112,113',
     424'114,115,117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,',
     425',147,,,,,,,,,,,,,,46,149,,,,,,,,,,,,,,,,,,,,,,,,,149,,,46,,,,,,,,,,',
     426',,,,,,,,,,,,149,45,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30',
     427'31,32,33,34,35,36,37,38,,,47,45,9,10,11,12,13,14,15,16,17,18,19,20,21',
     428'22,26,28,30,31,32,33,34,35,36,37,38,,41,47,294,375,,298,,,54,,,,,,,',
     429',56,,,,,,,,,,325,375,,298,,,,,,,,,,,,56,,,,,,,,9,10,11,12,13,14,15,16',
     430'17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14',
     431'15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,188,,,,,192',
     432',,,,,,,,,,,,,,,,,,,413,,,,,,,,,,,,,,,,,,,,,,9,10,11,12,13,14,15,16,17',
     433'18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14,15',
     434'16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,371,9,10,11,12',
     435'13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,,,,,',
     436'205,,,,,,,,,,,,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31',
     437'32,33,34,35,36,37,38,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28',
     438'30,31,32,33,34,35,36,37,38,307,,,,,,,,,,,,,,,,,,,,,,,,,381,,,,,,,,,',
     439',,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36',
     440'37,38,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34',
     441'35,36,37,38,302,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31',
     442'32,33,34,35,36,37,38,,,,,,,,,,,,9,10,11,12,13,14,15,16,17,18,19,20,21',
     443'22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14,15,16,17,18,19',
     444'20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14,15,16,17',
     445'18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14,15',
     446'16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13',
     447'14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11',
     448'12,13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9',
     449'10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37',
     450'38' ]
     451        racc_action_table = arr = ::Array.new(3198, nil)
    427452        idx = 0
    428453        clist.each do |str|
     
    434459
    435460clist = [
    436 '210,210,210,210,210,210,26,210,24,114,213,210,55,210,210,297,210,210',
    437 '210,210,210,210,210,211,211,211,211,211,211,332,211,298,332,299,211',
    438 '48,211,211,95,211,211,211,211,211,211,211,217,26,213,24,300,55,55,189',
    439 '189,189,189,189,189,48,189,114,114,90,189,50,189,189,172,189,189,189',
    440 '189,189,189,189,95,50,132,132,303,217,217,217,217,217,217,217,217,217',
    441 '217,166,85,210,189,189,189,189,189,189,189,189,189,189,189,101,172,189',
    442 '189,189,189,189,287,287,347,166,211,394,394,394,394,394,394,347,394',
    443 '259,288,288,394,101,394,394,84,394,394,394,394,394,394,394,181,181,181',
    444 '181,181,181,189,181,318,259,1,181,273,181,181,273,181,181,181,181,181',
    445 '181,181,194,194,194,194,194,194,51,194,289,289,322,194,51,194,194,70',
    446 '194,194,194,194,194,194,194,195,195,195,195,195,195,275,195,324,52,327',
    447 '195,52,195,195,275,195,195,195,195,195,195,195,51,394,248,80,180,248',
    448 '80,180,248,392,392,392,392,392,392,252,392,180,252,330,392,333,392,392',
    449 '181,392,392,392,392,392,392,392,342,152,335,286,152,69,342,152,286,286',
    450 '248,290,290,342,152,194,392,66,392,392,392,392,392,392,392,392,392,392',
    451 '392,392,339,392,392,392,392,392,291,291,195,392,64,392,392,392,392,63',
    452 '392,392,392,392,392,392,285,354,128,292,292,285,285,128,128,355,392',
    453 '392,392,392,392,392,392,392,392,381,381,381,381,381,381,356,381,295',
    454 '295,357,381,358,381,381,359,381,381,381,381,381,381,381,380,380,380',
    455 '380,380,380,365,380,129,129,369,380,371,380,380,22,380,380,380,380,380',
    456 '380,380,196,196,196,196,196,196,14,196,382,32,387,196,389,196,196,390',
    457 '196,196,196,196,196,196,196,197,197,197,197,197,197,12,197,137,137,393',
    458 '197,397,197,197,185,197,197,197,197,197,197,197,3,381,184,32,182,32',
    459 '32,32,32,32,32,32,32,32,32,32,178,2,32,32,32,32,32,177,380,32,72,72',
    460 '72,72,72,72,72,72,72,72,72,130,130,72,72,72,72,72,175,170,157,196,156',
    461 '32,32,32,32,32,32,32,32,2,150,2,2,2,2,2,2,2,2,2,2,2,197,148,2,2,2,2',
    462 '2,146,2,2,198,198,198,198,198,198,144,198,142,136,135,198,134,198,198',
    463 '133,198,198,198,198,198,198,198,2,2,2,2,2,2,2,2,215,379,379,379,379',
    464 '379,379,231,379,232,234,235,379,236,379,379,238,379,379,379,379,379',
    465 '379,379,160,94,54,240,264,241,160,94,54,242,264,244,111,160,94,54,379',
    466 '264,379,379,379,379,379,379,379,379,379,379,379,379,105,379,379,379',
    467 '379,379,104,98,198,379,97,379,379,379,379,91,379,379,379,379,379,379',
    468 '115,278,115,281,115,115,115,296,,,379,379,379,379,379,379,379,379,379',
    469 '171,171,171,171,171,171,,171,,,,171,,171,171,,171,171,171,171,171,171',
    470 '171,,,378,378,378,378,378,378,,378,,,,378,,378,378,,378,378,378,378',
    471 '378,378,378,76,4,74,,174,,76,4,74,,174,,,76,4,74,378,174,378,378,378',
    472 '378,378,378,378,378,378,378,378,378,,378,378,378,378,378,,,,378,,378',
    473 '378,378,378,171,378,378,378,378,378,378,294,294,294,294,131,131,131',
    474 '131,,,378,378,378,378,378,378,378,378,378,361,361,361,361,361,361,,361',
    475 ',,,361,,361,361,,361,361,361,361,361,361,361,218,293,293,293,293,,218',
    476 ',,,,,,218,,,361,,361,361,361,361,361,361,361,361,361,361,361,361,,361',
    477 '361,361,361,361,,,,361,,361,361,361,361,,361,361,361,361,361,361,,,',
    478 ',,,,,,,361,361,361,361,361,361,361,361,361,199,199,199,199,199,199,',
    479 '199,,,,199,,199,199,,199,199,199,199,199,199,199,350,350,350,350,350',
    480 '350,,350,,,,350,,350,350,,350,350,350,350,350,350,350,346,346,346,346',
    481 '346,346,,346,,,,346,,346,346,,346,346,346,346,346,346,346,191,191,191',
    482 '191,191,191,,191,,,,191,,191,191,,191,191,191,191,191,191,191,,199,',
    483 ',,,,,,200,200,200,200,200,200,,200,,,,200,,200,200,350,200,200,200,200',
    484 '200,200,200,336,336,336,336,336,336,,336,,336,,336,,336,336,346,336',
    485 '336,336,336,336,336,336,,,,,,,,323,323,323,323,323,323,,323,191,,,323',
    486 ',323,323,,323,323,323,323,323,323,323,,,,,,,,,,,,,,,,,323,200,323,323',
    487 '323,323,323,323,323,323,323,323,323,323,,323,323,323,323,323,,,,323',
    488 '336,323,323,323,323,,323,323,323,323,323,323,,,,,,,,,,,323,323,323,323',
    489 '323,323,323,323,323,321,321,321,321,321,321,,321,,,,321,,321,321,,321',
    490 '321,321,321,321,321,321,,,,,,,,,,,,,,,,,321,,321,321,321,321,321,321',
    491 '321,321,321,321,321,321,,321,321,321,321,321,,,,321,,321,321,321,321',
    492 ',321,321,321,321,321,321,,,,,,,,,,,321,321,321,321,321,321,321,321,321',
    493 '398,398,398,398,398,398,,398,,,,398,,398,398,,398,398,398,398,398,398',
    494 '398,,,,,,,,,,,,,,,,,398,,398,398,398,398,398,398,398,398,398,398,398',
    495 '398,,398,398,398,398,398,,,,398,,398,398,398,398,,398,398,398,398,398',
    496 '398,,,,,,,,,,,398,398,398,398,398,398,398,398,398,320,320,320,320,320',
    497 '320,,320,,,,320,,320,320,,320,320,320,320,320,320,320,319,319,319,319',
    498 '319,319,,319,,,,319,,319,319,,319,319,319,319,319,319,319,77,77,77,77',
    499 '77,77,,77,,,,77,,77,77,,77,77,77,77,77,77,77,317,317,317,317,317,317',
    500 ',317,,,,317,,317,317,,317,317,317,317,317,317,317,,320,,,,,77,,,,,,',
    501 '77,82,82,82,82,82,82,,82,,82,319,82,,82,82,,82,82,82,82,82,82,82,183',
    502 '183,183,183,183,183,,183,,,77,183,,183,183,,183,183,183,183,183,183',
    503 '183,316,316,316,316,316,316,,316,,,317,316,,316,316,,316,316,316,316',
    504 '316,316,316,304,304,304,304,304,304,,304,,,,304,,304,304,,304,304,304',
    505 '304,304,304,304,,82,,,,,,,,201,201,201,201,201,201,,201,,,,201,,201',
    506 '201,183,201,201,201,201,201,201,201,202,202,202,202,202,202,,202,,,',
    507 '202,,202,202,316,202,202,202,202,202,202,202,302,302,302,302,302,302',
    508 ',302,,,,302,,302,302,304,302,302,302,302,302,302,302,277,277,277,277',
    509 '277,277,,277,,,,277,,277,277,,277,277,277,277,277,277,277,,201,,,,,302',
    510 '302,,,,,,302,203,203,203,203,203,203,,203,,,202,203,,203,203,,203,203',
    511 '203,203,203,203,203,209,209,209,209,209,209,,209,,,302,209,,209,209',
    512 ',209,209,209,209,209,209,209,212,212,212,212,212,212,,212,,,277,212',
    513 ',212,212,,212,212,212,212,212,212,212,204,204,204,204,204,204,,204,',
    514 ',,204,,204,204,,204,204,204,204,204,204,204,,203,,,,,,,,271,271,271',
    515 '271,271,271,,271,,,,271,,271,271,209,271,271,271,271,271,271,271,205',
    516 '205,205,205,205,205,,205,,,,205,,205,205,212,205,205,205,205,205,205',
    517 '205,206,206,206,206,206,206,,206,,,,206,,206,206,204,206,206,206,206',
    518 '206,206,206,,,,,,,,,,145,145,145,145,145,145,,145,,,,145,,145,145,271',
    519 '145,145,145,145,145,145,145,,,,,,,,,,,,,,,,205,145,,145,145,145,145',
    520 '145,145,145,145,145,145,145,145,145,145,145,145,145,145,,,206,145,,145',
    521 '145,145,145,,145,145,145,145,145,145,,,,,,,,,,,145,145,145,145,145,145',
    522 '145,145,145,253,253,253,253,253,253,,253,,253,,253,,253,253,,253,253',
    523 '253,253,253,253,253,112,112,112,112,112,112,,112,,,,112,,112,112,,112',
    524 '112,112,112,112,112,112,38,38,38,38,38,38,38,38,38,38,38,,,38,38,38',
    525 '38,38,112,112,112,112,112,112,112,112,112,112,112,,,112,112,112,112',
    526 '112,,207,207,207,207,207,207,,207,,,253,207,,207,207,,207,207,207,207',
    527 '207,207,207,208,208,208,208,208,208,,208,,,112,208,,208,208,,208,208',
    528 '208,208,208,208,208,116,116,116,116,116,116,,116,,,,116,,116,116,,116',
    529 '116,116,116,116,116,116,117,117,117,117,117,117,,117,,,,117,,117,117',
    530 ',117,117,117,117,117,117,117,,207,,,,,,,,118,118,118,118,118,118,,118',
    531 ',,,118,,118,118,208,118,118,118,118,118,118,118,119,119,119,119,119',
    532 '119,,119,,,,119,,119,119,116,119,119,119,119,119,119,119,141,141,141',
    533 '141,141,141,,141,,,,141,,141,141,117,141,141,141,141,141,141,141,243',
    534 '243,243,243,243,243,,243,,,,243,,243,243,,243,243,243,243,243,243,243',
    535 ',118,,,,,141,,,,,,,141,,,243,,237,237,237,237,237,237,119,237,,,,237',
    536 ',237,237,,237,237,237,237,237,237,237,,,,,,,141,,,,,,,,,,,233,233,233',
    537 '233,233,233,,233,,,,233,243,233,233,,233,233,233,233,233,233,233,,,',
    538 ',,,,,,,,,,,,,233,,233,233,233,233,233,233,233,233,233,233,233,233,237',
    539 '233,233,233,233,233,,,,233,,233,233,233,233,,233,233,233,233,233,233',
    540 ',,,,,,274,274,,274,233,233,233,233,233,233,233,233,233,274,,,,,249,249',
    541 ',249,,,249,,,,,,,249,,,,,274,274,274,274,274,274,274,274,274,274,274',
    542 ',,274,274,274,274,274,249,249,249,249,249,249,249,249,249,249,249,,',
    543 '249,249,249,249,249,337,,,,,,,,274,274,274,274,274,274,274,274,,,83',
    544 ',,,,,,,249,249,249,249,249,249,249,249,,337,337,337,337,337,337,337',
    545 '337,337,337,337,,,337,337,337,337,337,83,83,83,83,83,83,83,83,83,83',
    546 '83,,,83,83,83,83,83,,,,247,,,,,337,337,337,337,337,337,337,337,,,,,',
    547 ',,,,,83,83,83,83,83,83,83,83,247,247,247,247,247,247,247,247,247,247',
    548 '247,,,247,247,247,247,247,5,5,5,5,5,5,5,5,5,5,5,,,5,5,5,5,5,,,,,,,,',
    549 '247,247,247,247,247,247,247,247,,,,,,,,,,,5,5,5,5,5,5,5,5,254,254,254',
    550 '254,254,254,254,254,254,254,254,,254,254,254,254,254,254,92,92,92,92',
    551 '92,92,92,92,92,92,92,,92,92,92,92,92,92,,,,,,,,,254,254,254,254,254',
    552 '254,254,254,,,,,,,,,,,92,92,92,92,92,92,92,92,155,155,155,155,155,155',
    553 '155,155,155,155,155,,,155,155,155,155,155,89,89,89,89,89,89,89,89,89',
    554 '89,89,,,89,89,89,89,89,,,,,,,,,155,155,155,155,155,155,155,155,,,,,',
    555 ',,,,,89,89,89,89,89,89,89,89,88,88,88,88,88,88,88,88,88,88,88,,,88,88',
    556 '88,88,88,158,158,158,158,158,158,158,158,158,158,158,,158,158,158,158',
    557 '158,158,,,,,,,,,88,88,88,88,88,88,88,88,,,,,,,,,,,158,158,158,158,158',
    558 '158,158,158,67,67,67,67,67,67,67,67,67,67,67,,,67,67,67,67,67,161,161',
    559 '161,161,161,161,161,161,161,161,161,,161,161,161,161,161,161,,,,,,,',
    560 ',67,67,67,67,67,67,67,67,,,,,,,,,,,161,161,161,161,161,161,161,161,7',
    561 '7,7,7,7,7,7,7,7,7,7,,,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,,,6,6,6,6,6,,',
    562 ',,,,,,7,7,7,7,7,7,7,7,,,,,,,,,,,6,6,6,6,6,6,6,6,73,73,73,73,73,73,73',
    563 '73,73,73,73,,,73,73,73,73,73' ]
    564         racc_action_check = arr = ::Array.new(2875, nil)
     461'440,440,440,440,440,440,293,440,56,293,52,440,293,440,440,440,52,139',
     462'440,440,440,440,440,440,440,438,438,438,438,438,438,106,438,354,326',
     463'103,438,65,438,438,438,151,326,438,438,438,438,438,438,438,88,29,440',
     464'31,51,29,354,31,109,56,56,56,120,207,286,120,106,120,293,120,120,120',
     465'52,328,212,324,151,438,324,212,51,440,440,440,328,440,440,440,440,440',
     466'440,440,440,440,440,318,110,49,207,286,318,88,88,88,142,142,438,438',
     467'438,31,438,438,438,438,438,438,438,438,438,438,436,436,436,436,436,436',
     468'304,436,120,120,120,436,49,436,436,436,428,362,436,436,436,436,436,436',
     469'436,98,116,428,362,304,316,98,227,340,222,316,309,222,340,340,98,304',
     470'309,167,167,167,167,167,167,222,167,309,436,226,167,333,167,167,167',
     471'167,98,167,167,167,167,167,167,167,394,4,297,309,339,297,334,4,225,339',
     472'339,394,66,436,436,436,4,436,436,436,436,436,436,436,436,436,436,167',
     473'167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167',
     474'167,167,167,167,167,167,167,167,267,267,101,167,167,167,95,167,167,167',
     475'167,167,167,167,167,167,167,429,429,429,429,429,429,364,429,68,373,94',
     476'429,373,429,429,429,87,364,429,429,429,429,429,429,429,427,427,427,427',
     477'427,427,187,427,71,83,217,427,83,427,427,427,217,187,427,427,427,427',
     478'427,427,427,217,269,429,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75',
     479'75,75,133,53,221,426,53,133,133,427,418,418,291,429,429,429,426,429',
     480'429,429,429,429,429,429,429,429,429,137,137,350,220,136,136,136,136',
     481'214,214,351,427,427,427,220,427,427,427,427,427,427,427,427,427,427',
     482'175,175,175,175,175,175,363,175,215,215,352,175,353,175,175,175,218',
     483'363,175,175,175,175,175,175,175,76,76,76,76,76,76,76,76,76,76,76,76',
     484'76,76,76,76,76,425,82,82,82,82,82,82,274,82,357,175,425,82,283,82,82',
     485'82,82,73,82,82,82,82,82,82,82,72,201,347,347,347,347,209,201,348,348',
     486'348,348,365,175,175,175,201,175,175,175,175,175,175,175,175,175,175',
     487'82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82',
     488'82,82,82,349,349,198,82,82,82,197,82,82,82,82,82,82,82,82,82,82,273',
     489'273,273,273,273,273,371,273,135,135,189,273,374,273,273,273,346,346',
     490'273,273,273,273,273,273,273,404,404,404,404,404,404,376,404,345,345',
     491'79,404,186,404,404,404,79,184,404,404,404,404,404,404,404,79,380,273',
     492'47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,344,344,343,343,342',
     493'342,138,404,99,99,179,273,273,273,178,273,273,273,273,273,273,273,273',
     494'273,273,131,131,131,131,131,131,131,131,131,131,131,404,404,404,177',
     495'404,404,404,404,404,404,404,404,404,404,402,402,402,402,402,402,176',
     496'402,341,341,395,402,396,402,402,402,134,134,402,402,402,402,402,402',
     497'402,275,275,275,275,275,275,102,275,27,403,77,275,25,275,275,275,77',
     498'23,275,275,275,275,275,275,275,77,55,402,152,384,191,174,55,191,152',
     499'384,191,173,408,412,414,55,416,152,384,191,281,422,172,140,165,141,275',
     500'163,149,3,402,402,402,437,402,402,402,402,402,402,402,402,402,402,147',
     501'1,,,,,,,,,,275,275,275,,275,275,275,275,275,275,275,275,275,275,360',
     502'360,360,360,360,360,,360,,,,360,,360,360,360,,,360,360,360,360,360,360',
     503'360,249,249,249,249,249,249,,249,,,,249,,249,249,,,,249,249,249,249',
     504'249,249,249,,,360,383,383,383,383,383,383,,383,,,,383,,383,383,,,,383',
     505'383,383,383,383,383,383,,,,360,360,360,,360,360,360,360,360,360,360',
     506'360,360,360,,,,,,,377,377,377,377,377,377,,377,,377,,377,,377,377,,',
     507'249,377,377,377,377,377,377,377,,,,367,367,367,367,367,367,,367,,,,367',
     508',367,367,,,383,367,367,367,367,367,367,367,366,366,366,366,366,366,',
     509'366,,,,366,,366,366,,,,366,366,366,366,366,366,366,,,367,,,,,,,,,,,',
     510',377,,393,393,393,393,393,393,,393,,,366,393,,393,393,,,,393,393,393',
     511'393,393,393,393,,367,,,,,,,,356,356,356,356,356,356,,356,,,,356,,356',
     512'356,356,356,366,356,356,356,356,356,356,356,330,330,330,330,330,330',
     513',330,,,,330,,330,330,,,,330,330,330,330,330,330,330,322,322,322,322',
     514'322,322,,322,,393,,322,,322,322,322,,,322,322,322,322,322,322,322,,',
     515',356,,,310,310,310,310,310,310,,310,,,,310,356,310,310,,,,310,310,310',
     516'310,310,310,310,298,298,298,298,298,298,,298,,298,,298,330,298,298,',
     517',,298,298,298,298,298,298,298,,,,,,,,,,,,,322,,,,,282,282,282,282,282',
     518'282,,282,,,,282,,282,282,,,,282,282,282,282,282,282,282,,310,,,,,,,',
     519',,,,,,,,,,,,,,,,,298,282,282,282,282,282,282,282,282,282,282,282,282',
     520'282,282,282,282,282,282,282,282,282,282,282,282,282,282,280,280,280',
     521'280,280,280,,280,,,,280,,280,280,282,,,280,280,280,280,280,280,280,146',
     522'146,146,146,146,146,,146,,,,146,,146,146,146,,,146,146,146,146,146,146',
     523'146,278,278,278,278,278,278,,278,,,,278,,278,278,,,,278,278,278,278',
     524'278,278,278,,397,397,397,397,397,397,,397,,,,397,,397,397,,,280,397',
     525'397,397,397,397,397,397,,,146,,,405,405,405,405,405,405,,405,,,,405',
     526'146,405,405,,,,405,405,405,405,405,405,405,271,271,271,271,271,271,',
     527'271,,,,271,278,271,271,,,,271,271,271,271,271,271,271,,266,266,266,266',
     528'266,266,,266,,,,266,397,266,266,,,,266,266,266,266,266,266,266,80,80',
     529'80,80,80,80,,80,,,,80,,80,80,80,,405,80,80,80,80,80,80,80,406,406,406',
     530'406,406,406,406,406,,,,406,,406,406,,,271,406,406,406,406,406,406,406',
     531',265,265,265,265,265,265,,265,,,,265,,265,265,,,266,265,265,265,265',
     532'265,265,265,,,80,,,85,85,85,85,85,85,,85,,85,,85,80,85,85,,,,85,85,85',
     533'85,85,85,85,264,264,264,264,264,264,,264,,,,264,406,264,264,,,,264,264',
     534'264,264,264,264,264,,263,263,263,263,263,263,,263,,,,263,265,263,263',
     535',,,263,263,263,263,263,263,263,262,262,262,262,262,262,,262,,,,262,',
     536'262,262,,,85,262,262,262,262,262,262,262,261,261,261,261,261,261,,261',
     537',,,261,,261,261,,,264,261,261,261,261,261,261,261,,260,260,260,260,260',
     538'260,,260,,,,260,,260,260,,,263,260,260,260,260,260,260,260,259,259,259',
     539'259,259,259,,259,,,,259,,259,259,,,262,259,259,259,259,259,259,259,258',
     540'258,258,258,258,258,,258,,,,258,,258,258,,,261,258,258,258,258,258,258',
     541'258,,257,257,257,257,257,257,,257,,,,257,,257,257,,,260,257,257,257',
     542'257,257,257,257,256,256,256,256,256,256,,256,,,,256,,256,256,,,259,256',
     543'256,256,256,256,256,256,255,255,255,255,255,255,,255,,,,255,,255,255',
     544',,258,255,255,255,255,255,255,255,,254,254,254,254,254,254,,254,,,,254',
     545',254,254,,,257,254,254,254,254,254,254,254,253,253,253,253,253,253,',
     546'253,,,,253,,253,253,,,256,253,253,253,253,253,253,253,252,252,252,252',
     547'252,252,,252,,,,252,,252,252,,,255,252,252,252,252,252,252,252,,251',
     548'251,251,251,251,251,,251,,,,251,,251,251,,,254,251,251,251,251,251,251',
     549'251,250,250,250,250,250,250,,250,,,,250,,250,250,,,253,250,250,250,250',
     550'250,250,250,389,389,389,389,389,389,,389,,,,389,,389,389,389,,252,389',
     551'389,389,389,389,389,389,,248,248,248,248,248,248,,248,,,,248,,248,248',
     552',,251,248,248,248,248,248,248,248,,,,,,,,,,,,,,,,,,250,,,,,,,,,,389',
     553',,117,117,117,117,117,117,,117,,,,117,389,117,117,,,,117,117,117,117',
     554'117,117,117,,236,236,236,236,236,236,,236,,,,236,248,236,236,,,,236',
     555'236,236,236,236,236,236,,,,,,,117,117,117,117,117,117,117,117,117,117',
     556'117,117,117,117,117,117,117,,,121,121,121,121,121,121,,121,,,,121,,121',
     557'121,,,117,121,121,121,121,121,121,121,,122,122,122,122,122,122,,122',
     558',,,122,,122,122,,,236,122,122,122,122,122,122,122,123,123,123,123,123',
     559'123,,123,,,,123,,123,123,,,,123,123,123,123,123,123,123,124,124,124',
     560'124,124,124,,124,,,,124,,124,124,,,121,124,124,124,124,124,124,124,',
     561',,,,,,,,,,,233,233,233,233,233,233,122,233,,,,233,,233,233,,,,233,233',
     562'233,233,233,233,233,223,223,223,223,223,223,123,223,,,,223,,223,223',
     563',,,223,223,223,223,223,223,223,,,,,,,124,233,233,233,233,233,233,233',
     564'233,233,233,233,233,233,233,233,233,233,,,231,231,231,231,231,231,,231',
     565',,,231,,231,231,,,233,231,231,231,231,231,231,231,224,224,224,224,224',
     566'224,224,224,,,,224,,224,224,,,223,224,224,224,224,224,224,224,,,,,,',
     567',231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231',
     568',,213,213,213,213,213,213,,213,,,,213,,213,213,,,231,213,213,213,213',
     569'213,213,213,210,210,210,210,210,210,,210,,,,210,,210,210,,,224,210,210',
     570'210,210,210,210,210,180,180,180,180,180,180,,180,,,,180,,180,180,,,',
     571'180,180,180,180,180,180,180,,407,407,407,407,407,407,407,407,,,,407',
     572',407,407,,,213,407,407,407,407,407,407,407,,180,,,,435,435,435,435,435',
     573'435,,435,,,,435,210,435,435,435,435,,435,435,435,435,435,435,435,164',
     574'164,164,164,164,164,,164,,,,164,180,164,164,,,,164,164,164,164,164,164',
     575'164,,279,279,279,279,279,279,,279,,,,279,407,279,279,,,,279,279,279',
     576'279,279,279,279,,,435,,,,,,,,,,,,,,41,435,,,,,,,,,,,,,,,,,,,,,,,,,164',
     577',,2,,,,,,,,,,,,,,,,,,,,,,,279,41,41,41,41,41,41,41,41,41,41,41,41,41',
     578'41,41,41,41,41,41,41,41,41,41,41,41,41,,,41,2,2,2,2,2,2,2,2,2,2,2,2',
     579'2,2,2,2,2,2,2,2,2,2,2,2,2,2,,2,2,294,294,,294,,,294,,,,,,,,,294,,,,',
     580',,,,,325,325,,325,,,,,,,,,,,,325,,,,,,,,294,294,294,294,294,294,294',
     581'294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294',
     582'294,325,325,325,325,325,325,325,325,325,325,325,325,325,325,325,325',
     583'325,325,325,325,325,325,325,325,325,86,,,,,86,,,,,,,,,,,,,,,,,,,,378',
     584',,,,,,,,,,,,,,,,,,,,,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86',
     585'86,86,86,86,86,86,86,86,86,378,378,378,378,378,378,378,378,378,378,378',
     586'378,378,378,378,378,378,378,378,378,378,378,378,378,378,292,7,7,7,7',
     587'7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,,,,,,96,,,,,,,,,,,,292,292',
     588'292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292',
     589'292,292,292,292,292,292,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96',
     590'96,96,96,96,96,96,96,96,96,96,202,,,,,,,,,,,,,,,,,,,,,,,,,299,,,,,,',
     591',,,,,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202',
     592'202,202,202,202,202,202,202,202,202,299,299,299,299,299,299,299,299',
     593'299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299',
     594'199,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92',
     595'92,92,92,,,,,,,,,,,,199,199,199,199,199,199,199,199,199,199,199,199',
     596'199,199,199,199,199,199,199,199,199,199,199,199,199,8,8,8,8,8,8,8,8',
     597'8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,196,196,196,196,196,196,196,196,196',
     598'196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,6,6',
     599'6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5',
     600'5,5,5,5,5,5,5,5,5,5,5,5,5,5,93,93,93,93,93,93,93,93,93,93,93,93,93,93',
     601'93,93,93,93,93,93,93,93,93,93,93,69,69,69,69,69,69,69,69,69,69,69,69',
     602'69,69,69,69,69,69,69,69,69,69,69,69,69' ]
     603        racc_action_check = arr = ::Array.new(3198, nil)
    565604        idx = 0
    566605        clist.each do |str|
     
    572611
    573612racc_action_pointer = [
    574    nil,   150,   420,   404,   652,  2412,  2762,  2744,   nil,   nil,
    575    nil,   nil,   346,   nil,   323,   nil,   nil,   nil,   nil,   nil,
    576    nil,   nil,   337,   nil,    -5,   nil,    -7,   nil,   nil,   nil,
    577    nil,   nil,   366,   nil,   nil,   nil,   nil,   nil,  1848,   nil,
    578    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    18,   nil,
    579     23,   162,   188,   nil,   534,    -8,   nil,   nil,   nil,   nil,
    580    nil,   nil,   nil,   232,   227,   nil,   204,  2674,   nil,   233,
    581    124,   nil,   387,  2814,   653,   nil,   651,  1303,   nil,   nil,
    582    205,   nil,  1363,  2342,   124,    72,   nil,   nil,  2604,  2552,
    583     22,   543,  2482,   nil,   533,    21,   nil,   537,   563,   nil,
    584    nil,    88,   nil,   nil,   533,   474,   nil,   nil,   nil,   nil,
    585    nil,   542,  1866,   nil,     2,   581,  1972,  1995,  2027,  2050,
    586    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   275,   322,
    587    414,   685,    45,   480,   461,   458,   456,   351,   nil,   nil,
    588    nil,  2073,   485,   nil,   477,  1749,   470,   nil,   467,   nil,
    589    445,   nil,   235,   nil,   nil,  2534,   411,   409,  2622,   nil,
    590    532,  2692,   nil,   nil,   nil,   nil,    74,   nil,   nil,   nil,
    591    436,   608,    51,   nil,   655,   435,   nil,   419,   412,   nil,
    592    206,   138,   401,  1386,   393,   383,   nil,   nil,   nil,    51,
    593    nil,   890,   nil,   nil,   161,   184,   356,   379,   482,   821,
    594    922,  1464,  1487,  1570,  1639,  1694,  1717,  1926,  1949,  1593,
    595     -2,    21,  1616,    -7,   nil,   506,   nil,     4,   745,   nil,
     613   nil,   732,  2528,   716,   182,  3068,  3043,  2752,  2993,   nil,
    596614   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    597    nil,   515,   517,  2177,   518,   519,   488,  2137,   491,   nil,
    598    529,   503,   507,  2096,   509,   nil,   nil,  2394,   204,  2271,
    599    nil,   nil,   217,  1843,  2464,   nil,   nil,   nil,   nil,   108,
    600    nil,   nil,   nil,   nil,   536,   nil,   nil,   nil,   nil,   nil,
    601    nil,  1671,   nil,   145,  2253,   184,   nil,  1533,   581,   nil,
    602    nil,   586,   nil,   nil,   nil,   273,   224,    91,   105,   144,
    603    225,   250,   269,   724,   681,   287,   579,   -20,    -5,    -4,
    604     10,   nil,  1510,    72,  1432,   nil,   nil,   nil,   nil,   nil,
    605    nil,   nil,   nil,   nil,   nil,   nil,  1409,  1326,    82,  1280,
    606   1257,  1069,   133,   975,   153,   nil,   nil,   155,   nil,   nil,
    607    216,   nil,    22,   222,   nil,   235,   945,  2324,   nil,   260,
    608    nil,   nil,   234,   nil,   nil,   nil,   867,   106,   nil,   nil,
    609    844,   nil,   nil,   nil,   253,   294,   310,   315,   283,   319,
    610    nil,   727,   nil,   nil,   nil,   329,   nil,   nil,   nil,   334,
    611    nil,   339,   nil,   nil,   nil,   nil,   nil,   nil,   633,   514,
    612    333,   310,   296,   nil,   nil,   nil,   nil,   303,   nil,   362,
    613    332,   nil,   216,   350,   115,   nil,   nil,   385,  1163,   nil ]
     615   nil,   nil,   nil,   624,   nil,   619,   nil,   656,   nil,    38,
     616   nil,    40,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     617   nil,  2499,   nil,   nil,   nil,   nil,   nil,   510,   nil,    78,
     618   nil,    37,     3,   322,   nil,   680,   -14,   nil,   nil,   nil,
     619   nil,   nil,   nil,   nil,   nil,    20,   183,   nil,   249,  3118,
     620   nil,   278,   429,   421,   nil,   252,   344,   664,   nil,   544,
     621  1392,   nil,   419,   285,   nil,  1473,  2701,   266,    28,   nil,
     622   nil,   nil,  2932,  3093,   214,   193,  2819,   nil,   138,   576,
     623   nil,   200,   654,    22,   nil,   nil,    12,   nil,   nil,    15,
     624     1,   nil,   nil,   nil,   nil,   nil,   137,  1959,   nil,   nil,
     625    55,  2035,  2061,  2086,  2111,   nil,   nil,   nil,   nil,   nil,
     626   nil,   568,   nil,   306,   629,   495,   326,   318,   571,   -20,
     627   672,   673,    64,   nil,   nil,   nil,  1235,   724,   nil,   702,
     628   nil,    22,   682,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     629   nil,   nil,   nil,   672,  2431,   669,   nil,   161,   nil,   nil,
     630   nil,   nil,   702,   691,   685,   376,   635,   612,   546,   542,
     631  2350,   nil,   nil,   nil,   547,   nil,   545,   281,   nil,   507,
     632   nil,   684,   nil,   nil,   nil,   nil,  3018,   451,   447,  2968,
     633   nil,   440,  2881,   nil,   nil,   nil,   nil,    44,   nil,   410,
     634  2325,   nil,    61,  2300,   343,   368,   nil,   286,   381,   nil,
     635   348,   322,   147,  2173,  2249,   189,   160,   139,   nil,   nil,
     636   nil,  2224,   nil,  2148,   nil,   nil,  1985,   nil,   nil,   nil,
     637   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,  1904,   779,
     638  1853,  1828,  1802,  1777,  1752,  1726,  1701,  1676,  1650,  1625,
     639  1600,  1574,  1549,  1524,  1498,  1443,  1367,   223,   nil,   300,
     640   nil,  1341,   nil,   514,   385,   659,   nil,   nil,  1260,  2457,
     641  1210,   619,  1132,   379,   nil,   nil,    45,   nil,   nil,   nil,
     642   nil,   325,  2794,    -1,  2604,   nil,   nil,   183,  1090,  2906,
     643   nil,   nil,   nil,   nil,   107,   nil,   nil,   nil,   nil,   149,
     644  1065,   nil,   nil,   nil,   nil,   nil,   137,   nil,    82,   nil,
     645   nil,   nil,  1034,   nil,    68,  2629,    23,   nil,    65,   nil,
     646  1009,   nil,   nil,   167,   186,   nil,   nil,   nil,   nil,   170,
     647   131,   621,   567,   559,   557,   520,   503,   417,   423,   464,
     648   334,   326,   350,   351,    14,   nil,   984,   421,   nil,   nil,
     649   754,   nil,   129,   376,   256,   451,   908,   883,   nil,   nil,
     650   nil,   510,   nil,   260,   520,   nil,   539,   855,  2726,   nil,
     651   556,   nil,   nil,   807,   683,   nil,   nil,   nil,   nil,  1878,
     652   nil,   nil,   nil,   950,   180,   629,   631,  1286,   nil,   nil,
     653   nil,   nil,   634,   653,   539,  1316,  1417,  2376,   687,   nil,
     654   nil,   nil,   689,   nil,   693,   nil,   649,   nil,   318,   nil,
     655   nil,   nil,   622,   nil,   nil,   412,   323,   281,   128,   256,
     656   nil,   nil,   nil,   nil,   nil,  2406,   118,   666,    23,   nil,
     657    -2,   nil,   nil,   nil,   nil,   nil,   nil ]
    614658
    615659racc_action_default = [
    616   -176,  -243,    -1,  -243,  -243,   -70,   -71,   -72,   -80,   -81,
    617    -82,   -83,   -84,   -85,   -86,   -87,   -88,   -89,   -90,   -91,
    618    -92,   -93,   -96,   -99,  -243,  -116,  -243,  -129,  -134,  -135,
    619   -177,  -178,  -243,  -180,  -181,  -184,  -185,  -186,  -243,  -232,
    620   -233,  -234,  -235,  -236,  -237,  -238,  -239,   400,  -243,   -76,
    621    -78,  -243,  -137,  -139,  -243,  -145,   -73,   -84,   -86,   -74,
    622    -75,  -183,  -182,   -98,  -243,  -102,  -115,  -243,  -119,  -243,
    623   -128,  -179,  -106,  -108,  -243,   -69,  -243,  -243,  -190,  -191,
    624   -136,  -138,  -243,  -243,  -243,  -146,  -147,   -94,  -243,  -243,
    625    -84,   -85,  -243,  -117,  -243,  -243,  -130,  -132,  -243,  -107,
    626   -109,  -243,  -188,   -77,   -78,    -2,    -3,    -4,    -5,    -6,
    627     -7,    -8,  -243,   -10,   -12,   -23,  -243,  -243,  -243,  -243,
    628    -29,   -30,   -31,   -32,   -33,   -34,   -35,   -37,   -41,   -44,
    629    -47,   -52,   -55,   -57,   -59,   -61,   -63,   -65,   -68,   -79,
    630   -170,  -243,  -243,  -240,  -243,  -243,  -243,  -142,  -243,  -144,
    631   -149,  -151,  -155,  -140,  -148,  -243,   -84,   -85,  -243,  -100,
    632   -243,  -243,  -122,  -121,  -114,  -118,  -243,  -123,  -125,  -126,
    633   -243,  -243,  -243,  -187,  -243,  -243,   -11,  -243,  -243,   -67,
    634   -156,   -20,  -243,  -243,  -243,  -243,   -18,   -19,   -24,  -243,
    635    -25,  -243,   -27,   -28,  -243,  -243,  -243,  -243,  -243,  -243,
    636   -243,  -243,  -243,  -243,  -243,  -243,  -243,  -243,  -243,  -243,
    637   -243,  -243,  -243,  -243,  -174,  -243,  -241,   -35,  -243,  -192,
    638   -193,  -194,  -195,  -196,  -197,  -198,  -199,  -200,  -201,  -202,
    639   -203,  -243,  -243,  -243,  -243,  -243,  -240,  -243,  -243,  -213,
    640   -243,  -243,  -243,  -243,  -243,  -141,  -143,  -243,  -158,  -243,
    641   -153,  -154,  -159,  -243,  -243,  -105,  -104,   -97,  -101,  -243,
    642   -110,  -112,  -113,  -120,  -243,  -131,  -133,  -127,  -189,  -242,
    643     -9,  -243,  -157,  -158,  -243,  -243,   -21,   -20,  -243,   -16,
    644    -17,  -243,   -38,   -39,   -40,   -42,   -43,   -45,   -46,   -48,
    645    -49,   -50,   -51,   -53,   -54,   -56,   -58,   -60,   -62,   -64,
    646   -243,  -171,  -243,  -243,  -243,  -221,  -222,  -223,  -224,  -225,
    647   -226,  -227,  -228,  -229,  -230,  -231,  -243,  -243,  -243,  -243,
    648   -243,  -243,  -243,  -243,  -243,  -215,  -216,  -243,  -218,  -219,
    649   -243,  -152,  -160,  -243,  -166,  -243,  -243,  -243,  -162,  -243,
    650    -95,  -103,  -243,  -124,   -36,   -13,  -243,  -243,   -15,   -26,
    651   -243,  -172,  -175,  -173,  -243,  -243,  -243,  -243,  -243,  -243,
    652   -210,  -243,  -212,  -214,  -217,  -243,  -161,  -167,  -164,  -243,
    653   -168,  -243,  -163,  -111,   -22,   -14,   -66,  -220,  -243,  -243,
    654   -243,  -243,  -243,  -211,  -150,  -165,  -169,  -204,  -206,  -243,
    655   -243,  -209,  -243,  -243,  -243,  -205,  -207,  -243,  -243,  -208 ]
     660  -215,  -269,    -1,  -269,  -269,   -86,   -88,   -90,   -92,   -98,
     661   -99,  -100,  -101,  -102,  -103,  -104,  -105,  -106,  -107,  -108,
     662  -109,  -110,  -111,  -112,  -113,  -114,  -115,  -118,  -121,  -269,
     663  -139,  -269,  -163,  -164,  -165,  -166,  -167,  -168,  -169,  -216,
     664  -217,  -269,  -219,  -220,  -223,  -224,  -225,  -269,   447,  -269,
     665   -94,   -96,  -269,  -171,  -173,  -269,  -180,   -87,  -112,  -114,
     666   -89,   -91,   -93,  -222,  -221,  -120,  -269,  -124,  -138,  -269,
     667  -142,  -269,  -155,  -158,  -218,  -130,  -132,  -269,   -85,  -269,
     668  -269,  -229,  -269,  -170,  -172,  -269,  -269,  -269,  -181,  -182,
     669  -184,  -116,  -269,  -269,  -112,  -113,  -269,  -140,  -269,  -269,
     670  -159,  -161,  -269,  -269,  -129,  -131,  -269,  -227,   -95,   -96,
     671    -2,    -3,    -4,    -5,    -6,    -7,    -8,  -269,   -10,   -12,
     672   -25,  -269,  -269,  -269,  -269,   -31,   -32,   -33,   -34,   -35,
     673   -36,   -37,   -39,   -43,   -46,   -49,   -54,   -57,   -59,   -61,
     674   -63,   -65,   -67,   -69,   -97,  -209,  -269,  -269,  -265,  -269,
     675   -82,  -269,  -269,  -230,  -231,  -232,  -233,  -234,  -235,  -236,
     676  -237,  -238,  -239,  -265,  -269,  -269,  -243,  -269,  -245,  -247,
     677  -248,  -249,  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -269,
     678  -269,  -268,   -37,   -84,  -269,  -176,  -269,  -269,  -179,  -186,
     679  -188,  -192,  -193,  -174,  -183,  -185,  -269,  -112,  -113,  -269,
     680  -122,  -269,  -269,  -145,  -144,  -137,  -141,  -269,  -146,  -148,
     681  -269,  -151,  -269,  -269,  -269,  -269,  -226,  -269,  -269,   -11,
     682  -269,  -269,  -195,  -269,  -269,  -269,  -269,  -269,   -19,   -20,
     683   -26,  -269,   -27,  -269,   -29,   -30,  -269,   -71,   -72,   -73,
     684   -74,   -75,   -76,   -77,   -78,   -79,   -80,   -81,  -269,  -269,
     685  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -269,
     686  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -213,  -269,
     687  -266,  -269,  -250,  -269,  -269,  -269,  -244,  -246,  -269,  -269,
     688  -269,  -269,  -269,  -269,  -261,  -262,  -269,  -263,  -175,  -177,
     689  -178,  -269,  -269,  -197,  -269,  -190,  -191,  -198,  -269,  -269,
     690  -128,  -127,  -119,  -123,  -269,  -133,  -135,  -136,  -143,  -269,
     691  -269,  -149,  -153,  -160,  -162,  -152,  -269,  -156,  -269,  -228,
     692  -267,    -9,  -269,  -196,  -197,  -269,  -269,   -14,  -269,   -23,
     693  -269,   -17,   -18,  -269,  -269,   -70,   -40,   -41,   -42,   -44,
     694   -45,   -47,   -48,   -50,   -51,   -52,   -53,   -55,   -56,   -58,
     695   -60,   -62,   -64,   -66,  -269,  -210,  -269,  -269,   -83,  -240,
     696  -269,  -242,  -269,  -269,  -269,  -269,  -269,  -269,  -260,  -264,
     697  -194,  -269,  -189,  -199,  -269,  -205,  -269,  -269,  -269,  -201,
     698  -269,  -117,  -125,  -269,  -269,  -147,  -150,  -154,  -157,  -269,
     699   -38,   -13,   -15,  -269,  -269,   -28,  -269,  -269,  -211,  -214,
     700  -212,  -241,  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -200,
     701  -206,  -203,  -269,  -207,  -269,  -202,  -269,  -134,  -269,   -24,
     702   -16,   -68,  -251,  -253,  -254,  -269,  -269,  -269,  -269,  -269,
     703  -187,  -204,  -208,  -126,   -21,  -269,  -269,  -269,  -269,  -256,
     704  -269,  -258,   -22,  -252,  -255,  -257,  -259 ]
    656705
    657706racc_goto_table = [
    658     50,     4,   177,   146,    56,    59,    60,   190,   192,   193,
    659    148,    86,   139,   138,   260,    80,   167,   188,   138,   158,
    660    275,   258,   178,    35,    31,   165,   332,    73,    12,    74,
    661     14,     4,   287,   288,    91,   217,    95,   293,   294,   251,
    662    304,   154,   219,     2,    85,   295,    92,   285,   286,   296,
    663     72,   332,   297,    35,    71,   157,    91,   298,    12,    91,
    664     14,    73,    73,    99,   100,   172,    94,   272,   161,   299,
    665    102,   276,   104,   278,   103,    63,   214,   138,   155,   177,
    666     64,   177,   152,   259,    72,    72,   254,   160,    94,    66,
    667    168,    94,   266,    90,   165,   282,   283,   284,   166,   281,
    668    265,    73,   300,   182,   331,   213,    30,   138,   248,   289,
    669    290,   291,   292,   101,   156,    90,   347,   258,    90,    78,
    670    145,     1,   157,   217,    72,   157,   nil,   nil,    91,   nil,
    671    318,   nil,   nil,   327,   nil,   nil,   273,   nil,   nil,   nil,
    672    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   250,   nil,
    673    nil,   nil,   nil,   nil,   160,   nil,   261,   160,   322,   nil,
    674     94,   nil,   nil,   nil,   nil,   nil,   nil,   276,   nil,   nil,
    675    268,   nil,   344,   138,   339,   nil,   nil,   nil,    73,   nil,
    676    nil,   156,   nil,   nil,   156,   nil,   343,    90,   nil,   138,
    677    nil,   nil,   nil,   nil,   354,   nil,   373,   nil,   nil,   nil,
    678    nil,    72,   nil,   nil,   nil,   248,   355,   356,   nil,   358,
    679    359,   217,    80,   217,   104,   nil,   nil,   nil,   360,   nil,
    680    362,   157,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    681    273,   nil,   nil,   nil,   nil,   nil,   374,   352,   138,   nil,
    682    nil,   nil,   nil,   nil,   nil,   nil,   152,   nil,   152,   nil,
    683    nil,   217,   nil,   160,   nil,   nil,   nil,   369,   383,   nil,
    684    168,   nil,   nil,   nil,   371,   nil,   nil,   nil,   217,   217,
    685    389,   390,   138,   152,   nil,   387,   388,   nil,   nil,   nil,
    686    156,   nil,   217,   nil,   397,   nil,   376,   nil,   217,   395,
    687    nil,   nil,   nil,   nil,   nil,   399,   nil,   nil,   nil,   nil,
     707    51,   144,   145,    81,   183,   182,   184,   281,   186,    23,
     708   267,    95,   208,    83,   206,   305,   303,   313,   328,   169,
     709    25,     4,   199,   230,    57,    60,    61,    62,    75,    89,
     710    40,    99,   168,   221,   198,    95,   296,    77,    95,   220,
     711   373,   182,   232,   234,   235,    65,    96,   207,    23,    76,
     712   304,   366,   343,   344,   345,   346,    75,    75,    90,    25,
     713     4,   194,   214,   215,    66,   104,   105,   323,   145,    74,
     714   202,   373,   196,   107,    68,   109,    94,    76,    76,   347,
     715   348,   339,   340,   183,   182,   274,   341,   342,    98,   108,
     716   195,   236,   187,    88,   209,   372,   353,   352,    75,   197,
     717    94,   152,   286,    94,   169,   359,    39,   361,   351,   106,
     718   350,   201,    98,   349,     2,    98,   303,   277,   167,    76,
     719   206,   313,   225,   313,   394,     1,   299,   nil,   nil,   183,
     720   182,   311,   183,   182,   314,   406,   407,   nil,   198,   nil,
     721   nil,   198,   nil,   nil,    95,   326,   329,   333,   109,   334,
     722   336,   337,   338,   220,   nil,   220,   nil,   nil,   335,   nil,
     723   nil,   nil,   nil,   nil,   293,   nil,   nil,   nil,   182,   182,
     724   182,   182,   182,   182,   182,   182,   182,   182,   182,   182,
     725   182,   182,   182,   182,   182,   182,   152,   295,   354,   nil,
     726   nil,   nil,   401,   358,   nil,   324,   nil,   306,   417,   nil,
     727   362,   363,   364,   197,   nil,   nil,   197,   nil,   nil,    94,
     728   nil,   nil,    75,   319,    75,   201,   nil,   nil,   201,   367,
     729   380,    98,   nil,   385,   390,   nil,   nil,   nil,   nil,   183,
     730   182,   386,   nil,    76,   422,    76,   424,   nil,   nil,   nil,
     731   nil,   198,   182,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     732   nil,   nil,   329,   418,    83,   nil,   nil,   nil,   nil,   439,
     733   nil,   441,   nil,   nil,   nil,   nil,   nil,   293,   443,   nil,
     734   445,   nil,   446,   nil,   nil,   nil,   nil,   399,   145,   nil,
     735   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     736   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   324,   412,
     737   414,   152,   183,   182,   416,   209,   197,   nil,   nil,   nil,
     738   nil,   145,   nil,   nil,   nil,   419,   421,   182,   201,   nil,
     739   nil,   nil,   nil,   nil,   nil,   nil,   nil,   425,   426,   428,
    688740   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    689741   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    690    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    691    nil,   nil,   nil,   nil,   nil,   nil,   152,   nil,   261 ]
    692 
    693 racc_goto_check = [
    694     32,    27,     6,    25,    27,    27,    27,    10,    10,    10,
    695     57,    55,    33,    24,    45,    56,    51,    12,    24,    39,
    696      8,    42,    13,    26,    64,    49,    61,     9,    34,    44,
    697     36,    27,    15,    15,    35,    10,    53,    17,    17,    60,
    698     79,    55,    70,     2,     9,    18,    48,    14,    14,    19,
    699     30,    61,    20,    26,    64,    35,    35,    21,    34,    35,
    700     36,     9,     9,    44,    44,    53,    27,    60,    48,    22,
    701     32,     6,    32,     6,    31,    38,    33,    24,    40,     6,
    702     41,     6,    27,    43,    30,    30,    39,    27,    27,    47,
    703     32,    27,    25,    34,    49,    12,    12,    12,    50,    13,
    704     54,     9,     6,     9,    59,    62,    63,    24,    55,    16,
    705     16,    16,    16,    67,    34,    34,     8,    42,    34,    68,
    706     69,     1,    35,    10,    30,    35,   nil,   nil,    35,   nil,
    707     70,   nil,   nil,     6,   nil,   nil,    55,   nil,   nil,   nil,
    708    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    32,   nil,
    709    nil,   nil,   nil,   nil,    27,   nil,    32,    27,    25,   nil,
    710     27,   nil,   nil,   nil,   nil,   nil,   nil,     6,   nil,   nil,
    711     32,   nil,    12,    24,    25,   nil,   nil,   nil,     9,   nil,
    712    nil,    34,   nil,   nil,    34,   nil,    51,    34,   nil,    24,
    713    nil,   nil,   nil,   nil,     6,   nil,    45,   nil,   nil,   nil,
    714    nil,    30,   nil,   nil,   nil,    55,     6,     6,   nil,     6,
    715      6,    10,    56,    10,    32,   nil,   nil,   nil,    70,   nil,
    716     70,    35,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    717     55,   nil,   nil,   nil,   nil,   nil,     6,    33,    24,   nil,
    718    nil,   nil,   nil,   nil,   nil,   nil,    27,   nil,    27,   nil,
    719    nil,    10,   nil,    27,   nil,   nil,   nil,    25,    70,   nil,
    720     32,   nil,   nil,   nil,    57,   nil,   nil,   nil,    10,    10,
    721      6,     6,    24,    27,   nil,    70,    70,   nil,   nil,   nil,
    722     34,   nil,    10,   nil,     6,   nil,    24,   nil,    10,    70,
    723    nil,   nil,   nil,   nil,   nil,    70,   nil,   nil,   nil,   nil,
     742   nil,   nil,   nil,   nil,   nil,   423,   399,   145,   nil,   nil,
    724743   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    725744   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     745   306 ]
     746
     747racc_goto_check = [
     748    36,    37,    12,    72,    26,    13,    28,    73,    60,    38,
     749    11,    39,    55,    59,    53,    49,    46,    57,     8,    29,
     750    40,    30,    43,    15,    30,    30,    30,    30,    33,    58,
     751    68,    56,    84,    10,    39,    39,    65,    48,    39,     6,
     752    66,    13,    13,    13,    13,    42,    52,    54,    38,     9,
     753    47,    75,    18,    18,    18,    18,    33,    33,     9,    40,
     754    30,    58,    56,    56,    45,    48,    48,    65,    12,    68,
     755    52,    66,    44,    36,    51,    36,    38,     9,     9,    19,
     756    19,    16,    16,    26,    13,    28,    17,    17,    30,    35,
     757     9,    27,    61,    62,    36,    64,    24,    23,    33,    38,
     758    38,    30,     6,    38,    29,    73,    67,    73,    22,    71,
     759    21,    30,    30,    20,     2,    30,    46,    84,    83,     9,
     760    53,    57,     9,    57,     8,     1,    43,   nil,   nil,    26,
     761    13,    28,    26,    13,    28,    75,    75,   nil,    39,   nil,
     762   nil,    39,   nil,   nil,    39,     6,    12,    10,    36,    10,
     763    15,    15,    15,     6,   nil,     6,   nil,   nil,    12,   nil,
     764   nil,   nil,   nil,   nil,    58,   nil,   nil,   nil,    13,    13,
     765    13,    13,    13,    13,    13,    13,    13,    13,    13,    13,
     766    13,    13,    13,    13,    13,    13,    30,    36,     6,   nil,
     767   nil,   nil,    73,    12,   nil,    58,   nil,    36,    49,   nil,
     768     6,     6,     6,    38,   nil,   nil,    38,   nil,   nil,    38,
     769   nil,   nil,    33,    36,    33,    30,   nil,   nil,    30,    29,
     770    12,    30,   nil,    55,    15,   nil,   nil,   nil,   nil,    26,
     771    13,    28,   nil,     9,    73,     9,    73,   nil,   nil,   nil,
     772   nil,    39,    13,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     773   nil,   nil,    12,    11,    59,   nil,   nil,   nil,   nil,    73,
     774   nil,    73,   nil,   nil,   nil,   nil,   nil,    58,    73,   nil,
     775    73,   nil,    73,   nil,   nil,   nil,   nil,    37,    12,   nil,
    726776   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    727    nil,   nil,   nil,   nil,   nil,   nil,    27,   nil,    32 ]
     777   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    58,    12,
     778    60,    30,    26,    13,    28,    36,    38,   nil,   nil,   nil,
     779   nil,    12,   nil,   nil,   nil,    12,    26,    13,    30,   nil,
     780   nil,   nil,   nil,   nil,   nil,   nil,   nil,     6,     6,     6,
     781   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     782   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     783   nil,   nil,   nil,   nil,   nil,    72,    37,    12,   nil,   nil,
     784   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     785   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     786    36 ]
    728787
    729788racc_goto_pointer = [
    730    nil,   121,    43,   nil,   nil,   nil,  -110,   nil,  -161,   -11,
    731   -110,   nil,   -99,   -90,  -150,  -167,   -92,  -168,  -162,  -159,
    732   -157,  -153,  -142,   nil,   -64,   -79,    21,    -1,   nil,   nil,
    733     12,    -2,    -4,   -65,    26,   -33,    28,   nil,    53,   -69,
    734     -9,    58,  -137,   -77,    -9,  -146,   nil,    65,   -21,   -67,
    735      4,   -78,   nil,   -33,   -70,   -44,   -36,   -73,   nil,  -143,
    736   -113,  -222,   -36,   104,    22,   nil,   nil,    39,    69,    41,
    737   -103,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,  -177 ]
     789   nil,   125,   114,   nil,   nil,   nil,   -78,   nil,  -206,     2,
     790   -84,  -136,   -78,   -80,   nil,   -98,  -170,  -167,  -203,  -180,
     791  -148,  -152,  -155,  -167,  -169,   nil,   -81,   -40,   -79,   -63,
     792    19,   nil,   nil,   -19,   nil,    10,    -4,   -79,     7,   -58,
     793    18,   nil,    18,   -70,   -19,    37,  -183,  -151,   -10,  -186,
     794   nil,    45,   -23,   -82,   -51,   -86,   -40,  -195,   -27,   -39,
     795   -78,     6,    37,   nil,  -197,  -155,  -253,   104,    28,   nil,
     796   nil,    32,   -48,  -168,   nil,  -231,   nil,   nil,   nil,   nil,
     797   nil,   nil,   nil,    36,   -50 ]
    738798
    739799racc_goto_default = [
    740    nil,   nil,   nil,   114,   105,   111,   244,   115,   nil,     7,
    741    126,   116,   127,   nil,   128,   129,   130,   131,   132,   133,
    742    134,   135,   136,   137,   179,   140,   220,   218,    48,     5,
    743      6,    49,    84,   nil,    57,    13,    58,    22,   nil,   nil,
    744    nil,   nil,   159,   nil,   180,   nil,    24,   nil,   nil,    93,
    745    nil,   nil,    26,   nil,    96,    51,    52,   335,   150,   151,
    746    333,   252,   nil,   nil,   nil,    33,    34,   nil,   227,   nil,
    747    nil,   221,   222,   223,   224,   225,   226,   228,   229,   nil ]
     800   nil,   nil,   nil,   119,   110,   116,   151,   120,   nil,     7,
     801   nil,   nil,   150,   131,   121,   132,   133,   134,   135,   136,
     802   137,   138,   139,   140,   141,   142,   143,   nil,   nil,    44,
     803   191,    49,     5,     6,     8,    50,    87,   268,    58,    24,
     804    59,    27,   nil,   nil,   nil,   nil,   200,   nil,   222,   nil,
     805    29,   nil,   nil,    97,   nil,   nil,   nil,   100,    52,    53,
     806   376,   nil,   nil,   189,   190,   374,   297,   nil,   nil,    42,
     807    43,   nil,   154,   170,   153,   155,   156,   157,   158,   159,
     808   160,   161,   162,   nil,   nil ]
    748809
    749810racc_reduce_table = [
    750811  0, 0, :racc_error,
    751   1, 97, :_reduce_none,
    752   1, 99, :_reduce_2,
    753   1, 99, :_reduce_3,
    754   1, 99, :_reduce_4,
    755   1, 99, :_reduce_5,
    756   1, 99, :_reduce_6,
    757   1, 99, :_reduce_7,
    758   1, 99, :_reduce_8,
    759   3, 99, :_reduce_9,
    760   1, 101, :_reduce_10,
    761   2, 101, :_reduce_11,
    762   1, 103, :_reduce_none,
    763   4, 103, :_reduce_none,
    764   5, 103, :_reduce_none,
    765   4, 103, :_reduce_15,
    766   3, 103, :_reduce_16,
    767   3, 103, :_reduce_17,
    768   2, 103, :_reduce_18,
    769   2, 103, :_reduce_19,
    770   0, 104, :_reduce_none,
     812  1, 98, :_reduce_none,
     813  1, 100, :_reduce_2,
     814  1, 100, :_reduce_3,
     815  1, 100, :_reduce_4,
     816  1, 100, :_reduce_5,
     817  1, 100, :_reduce_6,
     818  1, 100, :_reduce_7,
     819  1, 100, :_reduce_8,
     820  3, 100, :_reduce_9,
     821  1, 102, :_reduce_10,
     822  2, 102, :_reduce_11,
    771823  1, 104, :_reduce_none,
     824  4, 104, :_reduce_13,
    772825  3, 104, :_reduce_none,
    773   1, 106, :_reduce_none,
    774   2, 106, :_reduce_24,
    775   2, 106, :_reduce_25,
    776   4, 106, :_reduce_26,
    777   2, 106, :_reduce_27,
    778   2, 106, :_reduce_28,
    779   1, 107, :_reduce_29,
    780   1, 107, :_reduce_30,
    781   1, 107, :_reduce_31,
    782   1, 107, :_reduce_32,
    783   1, 107, :_reduce_33,
    784   1, 107, :_reduce_34,
    785   1, 108, :_reduce_none,
    786   4, 108, :_reduce_36,
     826  4, 104, :_reduce_none,
     827  5, 104, :_reduce_none,
     828  3, 104, :_reduce_17,
     829  3, 104, :_reduce_18,
     830  2, 104, :_reduce_19,
     831  2, 104, :_reduce_20,
     832  6, 104, :_reduce_none,
     833  7, 104, :_reduce_none,
     834  1, 105, :_reduce_none,
     835  3, 105, :_reduce_none,
    787836  1, 110, :_reduce_none,
    788   3, 110, :_reduce_38,
    789   3, 110, :_reduce_39,
    790   3, 110, :_reduce_40,
    791   1, 111, :_reduce_none,
    792   3, 111, :_reduce_42,
    793   3, 111, :_reduce_43,
     837  2, 110, :_reduce_26,
     838  2, 110, :_reduce_27,
     839  4, 110, :_reduce_28,
     840  2, 110, :_reduce_29,
     841  2, 110, :_reduce_30,
     842  1, 111, :_reduce_31,
     843  1, 111, :_reduce_32,
     844  1, 111, :_reduce_33,
     845  1, 111, :_reduce_34,
     846  1, 111, :_reduce_35,
     847  1, 111, :_reduce_36,
    794848  1, 112, :_reduce_none,
    795   3, 112, :_reduce_45,
    796   3, 112, :_reduce_46,
     849  4, 112, :_reduce_38,
    797850  1, 113, :_reduce_none,
    798   3, 113, :_reduce_48,
    799   3, 113, :_reduce_49,
    800   3, 113, :_reduce_50,
    801   3, 113, :_reduce_51,
     851  3, 113, :_reduce_40,
     852  3, 113, :_reduce_41,
     853  3, 113, :_reduce_42,
    802854  1, 114, :_reduce_none,
    803   3, 114, :_reduce_53,
    804   3, 114, :_reduce_54,
     855  3, 114, :_reduce_44,
     856  3, 114, :_reduce_45,
    805857  1, 115, :_reduce_none,
    806   3, 115, :_reduce_56,
     858  3, 115, :_reduce_47,
     859  3, 115, :_reduce_48,
    807860  1, 116, :_reduce_none,
    808   3, 116, :_reduce_58,
     861  3, 116, :_reduce_50,
     862  3, 116, :_reduce_51,
     863  3, 116, :_reduce_52,
     864  3, 116, :_reduce_53,
    809865  1, 117, :_reduce_none,
    810   3, 117, :_reduce_60,
     866  3, 117, :_reduce_55,
     867  3, 117, :_reduce_56,
    811868  1, 118, :_reduce_none,
    812   3, 118, :_reduce_62,
     869  3, 118, :_reduce_58,
    813870  1, 119, :_reduce_none,
    814   3, 119, :_reduce_64,
     871  3, 119, :_reduce_60,
    815872  1, 120, :_reduce_none,
    816   5, 120, :_reduce_66,
    817   1, 102, :_reduce_67,
    818   1, 121, :_reduce_68,
    819   3, 122, :_reduce_none,
    820   1, 123, :_reduce_70,
     873  3, 120, :_reduce_62,
     874  1, 121, :_reduce_none,
     875  3, 121, :_reduce_64,
     876  1, 122, :_reduce_none,
     877  3, 122, :_reduce_66,
    821878  1, 123, :_reduce_none,
    822   1, 123, :_reduce_72,
    823   2, 123, :_reduce_73,
    824   2, 123, :_reduce_74,
    825   2, 123, :_reduce_75,
    826   1, 124, :_reduce_76,
    827   3, 124, :_reduce_77,
     879  5, 123, :_reduce_68,
     880  1, 109, :_reduce_none,
     881  3, 109, :_reduce_none,
     882  1, 124, :_reduce_none,
     883  1, 124, :_reduce_none,
     884  1, 124, :_reduce_none,
     885  1, 124, :_reduce_none,
     886  1, 124, :_reduce_none,
     887  1, 124, :_reduce_none,
     888  1, 124, :_reduce_none,
     889  1, 124, :_reduce_none,
     890  1, 124, :_reduce_none,
     891  1, 124, :_reduce_none,
     892  1, 124, :_reduce_none,
     893  1, 103, :_reduce_82,
     894  3, 103, :_reduce_83,
     895  1, 125, :_reduce_84,
     896  3, 126, :_reduce_none,
     897  1, 127, :_reduce_86,
     898  2, 127, :_reduce_87,
    828899  1, 127, :_reduce_none,
    829   3, 127, :_reduce_79,
    830   1, 126, :_reduce_80,
    831   1, 126, :_reduce_81,
    832   1, 126, :_reduce_82,
    833   1, 126, :_reduce_83,
    834   1, 126, :_reduce_84,
    835   1, 126, :_reduce_85,
    836   1, 126, :_reduce_86,
    837   1, 126, :_reduce_87,
    838   1, 126, :_reduce_88,
    839   1, 126, :_reduce_89,
    840   1, 126, :_reduce_90,
    841   1, 126, :_reduce_91,
    842   1, 126, :_reduce_92,
    843   1, 126, :_reduce_93,
    844   0, 136, :_reduce_94,
    845   6, 130, :_reduce_95,
    846   0, 137, :_reduce_96,
    847   5, 130, :_reduce_97,
    848   2, 130, :_reduce_98,
    849   1, 133, :_reduce_99,
    850   1, 135, :_reduce_none,
    851   2, 135, :_reduce_none,
    852   1, 134, :_reduce_102,
    853   3, 138, :_reduce_103,
    854   2, 138, :_reduce_none,
    855   2, 138, :_reduce_none,
     900  2, 127, :_reduce_89,
     901  1, 127, :_reduce_90,
     902  2, 127, :_reduce_91,
     903  1, 127, :_reduce_none,
     904  2, 127, :_reduce_none,
     905  1, 128, :_reduce_94,
     906  3, 128, :_reduce_95,
     907  1, 132, :_reduce_none,
     908  3, 132, :_reduce_97,
     909  1, 129, :_reduce_none,
     910  1, 129, :_reduce_none,
     911  1, 129, :_reduce_none,
     912  1, 129, :_reduce_none,
     913  1, 130, :_reduce_102,
     914  1, 130, :_reduce_103,
     915  1, 130, :_reduce_104,
     916  1, 130, :_reduce_105,
     917  1, 130, :_reduce_106,
     918  1, 130, :_reduce_107,
     919  1, 130, :_reduce_108,
     920  1, 130, :_reduce_109,
     921  1, 130, :_reduce_110,
     922  1, 130, :_reduce_111,
     923  1, 130, :_reduce_112,
     924  1, 130, :_reduce_113,
     925  1, 130, :_reduce_114,
     926  1, 130, :_reduce_115,
     927  0, 141, :_reduce_116,
     928  6, 135, :_reduce_117,
     929  0, 142, :_reduce_118,
     930  5, 135, :_reduce_119,
     931  2, 135, :_reduce_120,
     932  1, 138, :_reduce_121,
    856933  1, 140, :_reduce_none,
    857   2, 140, :_reduce_107,
    858   1, 140, :_reduce_108,
    859   2, 140, :_reduce_109,
    860   1, 139, :_reduce_110,
    861   3, 139, :_reduce_111,
    862   1, 141, :_reduce_none,
    863   5, 131, :_reduce_none,
    864   4, 131, :_reduce_none,
    865   2, 131, :_reduce_none,
    866   1, 142, :_reduce_116,
    867   1, 144, :_reduce_none,
    868   2, 144, :_reduce_none,
    869   1, 143, :_reduce_none,
    870   3, 145, :_reduce_none,
    871   2, 145, :_reduce_none,
    872   2, 145, :_reduce_none,
     934  2, 140, :_reduce_none,
     935  1, 139, :_reduce_124,
     936  3, 143, :_reduce_125,
     937  5, 143, :_reduce_126,
     938  2, 143, :_reduce_none,
     939  2, 143, :_reduce_none,
     940  2, 145, :_reduce_129,
     941  1, 145, :_reduce_none,
     942  2, 145, :_reduce_131,
     943  1, 145, :_reduce_132,
     944  1, 144, :_reduce_133,
     945  3, 144, :_reduce_134,
    873946  1, 146, :_reduce_none,
    874   3, 146, :_reduce_none,
    875   1, 147, :_reduce_none,
    876   4, 132, :_reduce_none,
    877   5, 132, :_reduce_none,
    878   2, 132, :_reduce_none,
    879   1, 148, :_reduce_129,
     947  5, 136, :_reduce_none,
     948  4, 136, :_reduce_none,
     949  2, 136, :_reduce_none,
     950  1, 147, :_reduce_139,
    880951  1, 149, :_reduce_none,
    881   3, 149, :_reduce_none,
    882   1, 150, :_reduce_none,
     952  2, 149, :_reduce_none,
     953  1, 148, :_reduce_none,
    883954  3, 150, :_reduce_none,
    884   1, 105, :_reduce_134,
    885   1, 105, :_reduce_135,
    886   2, 128, :_reduce_136,
    887   1, 128, :_reduce_none,
    888   2, 128, :_reduce_138,
    889   1, 152, :_reduce_139,
    890   3, 152, :_reduce_140,
    891   4, 152, :_reduce_141,
    892   3, 152, :_reduce_142,
    893   4, 152, :_reduce_143,
    894   3, 152, :_reduce_144,
    895   1, 151, :_reduce_145,
    896   2, 151, :_reduce_146,
    897   2, 151, :_reduce_147,
    898   3, 151, :_reduce_148,
     955  2, 150, :_reduce_none,
     956  2, 150, :_reduce_none,
     957  1, 151, :_reduce_none,
     958  3, 151, :_reduce_none,
     959  1, 152, :_reduce_none,
     960  2, 152, :_reduce_none,
     961  3, 152, :_reduce_none,
     962  4, 137, :_reduce_none,
     963  5, 137, :_reduce_none,
     964  5, 137, :_reduce_none,
     965  6, 137, :_reduce_none,
     966  2, 137, :_reduce_none,
     967  5, 137, :_reduce_none,
     968  6, 137, :_reduce_none,
     969  2, 137, :_reduce_none,
    899970  1, 153, :_reduce_none,
    900   5, 153, :_reduce_none,
     971  3, 153, :_reduce_none,
    901972  1, 154, :_reduce_none,
    902973  3, 154, :_reduce_none,
    903   2, 155, :_reduce_none,
    904   2, 155, :_reduce_none,
    905   1, 155, :_reduce_none,
    906   1, 109, :_reduce_none,
    907   2, 109, :_reduce_none,
    908   1, 156, :_reduce_none,
    909   1, 156, :_reduce_none,
    910   2, 156, :_reduce_none,
    911   3, 157, :_reduce_none,
    912   2, 157, :_reduce_none,
    913   3, 157, :_reduce_none,
    914   3, 157, :_reduce_none,
    915   4, 157, :_reduce_none,
    916   2, 157, :_reduce_166,
    917   3, 157, :_reduce_none,
    918   3, 157, :_reduce_168,
    919   4, 157, :_reduce_none,
    920   1, 129, :_reduce_170,
    921   3, 129, :_reduce_171,
    922   4, 129, :_reduce_172,
    923   4, 129, :_reduce_173,
    924   1, 158, :_reduce_174,
    925   3, 158, :_reduce_175,
    926   0, 98, :_reduce_none,
    927   2, 98, :_reduce_none,
     974  1, 106, :_reduce_163,
     975  1, 106, :_reduce_none,
     976  1, 106, :_reduce_165,
     977  1, 131, :_reduce_none,
     978  1, 131, :_reduce_none,
     979  1, 131, :_reduce_none,
     980  1, 131, :_reduce_none,
     981  2, 133, :_reduce_170,
     982  1, 133, :_reduce_none,
     983  2, 133, :_reduce_172,
     984  1, 156, :_reduce_173,
     985  3, 156, :_reduce_174,
     986  4, 156, :_reduce_175,
     987  3, 156, :_reduce_176,
     988  4, 156, :_reduce_177,
     989  4, 156, :_reduce_none,
     990  3, 156, :_reduce_179,
     991  1, 155, :_reduce_180,
     992  2, 155, :_reduce_181,
     993  2, 155, :_reduce_182,
     994  3, 155, :_reduce_183,
    928995  1, 159, :_reduce_none,
    929996  2, 159, :_reduce_none,
     997  1, 157, :_reduce_none,
     998  5, 157, :_reduce_none,
    930999  1, 160, :_reduce_none,
    931   1, 160, :_reduce_none,
    932   2, 160, :_reduce_none,
    933   2, 160, :_reduce_none,
    934   1, 160, :_reduce_none,
    935   1, 160, :_reduce_none,
    936   1, 160, :_reduce_none,
    937   4, 161, :_reduce_187,
    938   1, 163, :_reduce_188,
    939   3, 163, :_reduce_189,
    940   3, 162, :_reduce_none,
    941   0, 165, :_reduce_none,
     1000  3, 160, :_reduce_none,
     1001  2, 161, :_reduce_none,
     1002  2, 161, :_reduce_none,
     1003  1, 161, :_reduce_none,
     1004  1, 158, :_reduce_none,
     1005  3, 158, :_reduce_none,
     1006  1, 107, :_reduce_none,
     1007  2, 107, :_reduce_none,
     1008  1, 162, :_reduce_none,
     1009  1, 162, :_reduce_none,
     1010  2, 162, :_reduce_none,
     1011  3, 163, :_reduce_none,
     1012  2, 163, :_reduce_none,
     1013  3, 163, :_reduce_none,
     1014  3, 163, :_reduce_none,
     1015  4, 163, :_reduce_none,
     1016  2, 163, :_reduce_205,
     1017  3, 163, :_reduce_none,
     1018  3, 163, :_reduce_207,
     1019  4, 163, :_reduce_none,
     1020  1, 134, :_reduce_209,
     1021  3, 134, :_reduce_210,
     1022  4, 134, :_reduce_211,
     1023  4, 134, :_reduce_212,
     1024  1, 108, :_reduce_213,
     1025  3, 108, :_reduce_214,
     1026  0, 99, :_reduce_none,
     1027  2, 99, :_reduce_none,
     1028  1, 164, :_reduce_none,
     1029  2, 164, :_reduce_none,
     1030  1, 165, :_reduce_none,
     1031  1, 165, :_reduce_none,
    9421032  2, 165, :_reduce_none,
    943   1, 166, :_reduce_none,
    944   1, 166, :_reduce_none,
    945   1, 166, :_reduce_none,
    946   1, 166, :_reduce_none,
    947   1, 166, :_reduce_none,
    948   1, 166, :_reduce_none,
    949   1, 166, :_reduce_none,
    950   1, 166, :_reduce_none,
    951   1, 166, :_reduce_none,
    952   1, 166, :_reduce_none,
    953   1, 166, :_reduce_none,
    954   5, 167, :_reduce_none,
    955   7, 167, :_reduce_none,
    956   5, 168, :_reduce_none,
    957   7, 169, :_reduce_none,
    958   9, 170, :_reduce_none,
    959   5, 171, :_reduce_none,
    960   3, 172, :_reduce_none,
    961   4, 172, :_reduce_none,
    962   3, 172, :_reduce_none,
    963   3, 164, :_reduce_none,
    964   3, 173, :_reduce_none,
    965   2, 173, :_reduce_none,
    966   2, 173, :_reduce_none,
    967   3, 173, :_reduce_none,
    968   2, 173, :_reduce_none,
    969   2, 174, :_reduce_none,
    970   4, 174, :_reduce_none,
    971   1, 175, :_reduce_none,
    972   1, 175, :_reduce_none,
    973   1, 175, :_reduce_none,
    974   1, 175, :_reduce_none,
    975   1, 175, :_reduce_none,
    976   1, 175, :_reduce_none,
    977   1, 175, :_reduce_none,
    978   1, 175, :_reduce_none,
    979   1, 175, :_reduce_none,
    980   1, 175, :_reduce_none,
    981   1, 175, :_reduce_none,
    982   1, 125, :_reduce_none,
    983   1, 125, :_reduce_none,
    984   1, 125, :_reduce_none,
    985   1, 125, :_reduce_none,
    986   1, 125, :_reduce_none,
    987   1, 125, :_reduce_none,
    988   1, 125, :_reduce_none,
    989   1, 125, :_reduce_none,
    990   1, 100, :_reduce_240,
    991   2, 100, :_reduce_241,
    992   3, 100, :_reduce_242 ]
    993 
    994 racc_reduce_n = 243
    995 
    996 racc_shift_n = 400
     1033  2, 165, :_reduce_none,
     1034  1, 165, :_reduce_none,
     1035  1, 165, :_reduce_none,
     1036  1, 165, :_reduce_none,
     1037  4, 166, :_reduce_226,
     1038  1, 168, :_reduce_227,
     1039  3, 168, :_reduce_228,
     1040  3, 167, :_reduce_none,
     1041  1, 170, :_reduce_none,
     1042  1, 170, :_reduce_none,
     1043  1, 170, :_reduce_none,
     1044  1, 170, :_reduce_none,
     1045  1, 170, :_reduce_none,
     1046  1, 170, :_reduce_none,
     1047  1, 170, :_reduce_none,
     1048  1, 170, :_reduce_none,
     1049  1, 170, :_reduce_none,
     1050  1, 170, :_reduce_none,
     1051  3, 171, :_reduce_none,
     1052  4, 171, :_reduce_none,
     1053  3, 171, :_reduce_none,
     1054  2, 169, :_reduce_none,
     1055  3, 169, :_reduce_none,
     1056  1, 180, :_reduce_none,
     1057  2, 180, :_reduce_none,
     1058  1, 181, :_reduce_none,
     1059  1, 181, :_reduce_none,
     1060  1, 172, :_reduce_none,
     1061  2, 172, :_reduce_none,
     1062  5, 173, :_reduce_none,
     1063  7, 173, :_reduce_none,
     1064  5, 177, :_reduce_none,
     1065  5, 174, :_reduce_none,
     1066  7, 175, :_reduce_none,
     1067  6, 176, :_reduce_none,
     1068  7, 176, :_reduce_none,
     1069  6, 176, :_reduce_none,
     1070  7, 176, :_reduce_none,
     1071  3, 178, :_reduce_none,
     1072  2, 178, :_reduce_none,
     1073  2, 178, :_reduce_none,
     1074  2, 178, :_reduce_none,
     1075  3, 178, :_reduce_none,
     1076  1, 101, :_reduce_265,
     1077  2, 101, :_reduce_266,
     1078  3, 101, :_reduce_267,
     1079  1, 179, :_reduce_268 ]
     1080
     1081racc_reduce_n = 269
     1082
     1083racc_shift_n = 447
    9971084
    9981085racc_token_table = {
     
    10141101  "++" => 15,
    10151102  "--" => 16,
    1016   "," => 17,
    1017   :SIZEOF => 18,
    1018   "&" => 19,
    1019   "*" => 20,
    1020   "+" => 21,
    1021   "-" => 22,
    1022   "~" => 23,
    1023   "!" => 24,
    1024   "/" => 25,
    1025   "%" => 26,
    1026   "<<" => 27,
    1027   ">>" => 28,
    1028   "<" => 29,
    1029   ">" => 30,
    1030   "<=" => 31,
    1031   ">=" => 32,
    1032   "==" => 33,
    1033   "!=" => 34,
    1034   "^" => 35,
    1035   "|" => 36,
    1036   "&&" => 37,
    1037   "||" => 38,
    1038   "?" => 39,
    1039   ":" => 40,
    1040   ";" => 41,
    1041   "=" => 42,
    1042   :VOID => 43,
    1043   :FLOAT => 44,
    1044   :DOUBLE => 45,
    1045   :BOOL => 46,
    1046   :TYPE_NAME => 47,
    1047   :CHAR => 48,
    1048   :SHORT => 49,
    1049   :INT => 50,
    1050   :LONG => 51,
    1051   :SIGNED => 52,
    1052   :UNSIGNED => 53,
    1053   "{" => 54,
    1054   "}" => 55,
    1055   :STRUCT => 56,
    1056   :UNION => 57,
    1057   :ENUM => 58,
    1058   :CONST => 59,
    1059   :VOLATILE => 60,
    1060   :C_EXP => 61,
    1061   :EXTENSION => 62,
    1062   :TYPEDEF => 63,
    1063   :IF => 64,
    1064   :ELSE => 65,
    1065   :WHILE => 66,
    1066   :DO => 67,
    1067   :FOR => 68,
    1068   :SWITCH => 69,
    1069   :infunc_statment => 70,
    1070   :CASE => 71,
    1071   :DEFAULT => 72,
    1072   :GOTO => 73,
    1073   :CONTINUE => 74,
    1074   :BREAK => 75,
    1075   :RETURN => 76,
    1076   "+=" => 77,
    1077   "-=" => 78,
    1078   "*=" => 79,
    1079   "/=" => 80,
    1080   "%=" => 81,
    1081   "<<=" => 82,
    1082   ">>=" => 83,
    1083   "&=" => 84,
    1084   "|=" => 85,
    1085   "^=" => 86,
    1086   :__INLINE__ => 87,
    1087   :INLINE => 88,
    1088   :__INLINE => 89,
    1089   :CINLINE => 90,
    1090   :EXTERN => 91,
    1091   :STATIC => 92,
    1092   :AUTO => 93,
    1093   :REGISTER => 94,
    1094   "::" => 95 }
    1095 
    1096 racc_nt_base = 96
     1103  "{" => 17,
     1104  "}" => 18,
     1105  "," => 19,
     1106  :SIZEOF => 20,
     1107  "&" => 21,
     1108  "*" => 22,
     1109  "+" => 23,
     1110  "-" => 24,
     1111  "~" => 25,
     1112  "!" => 26,
     1113  "/" => 27,
     1114  "%" => 28,
     1115  "<<" => 29,
     1116  ">>" => 30,
     1117  "<" => 31,
     1118  ">" => 32,
     1119  "<=" => 33,
     1120  ">=" => 34,
     1121  "==" => 35,
     1122  "!=" => 36,
     1123  "^" => 37,
     1124  "|" => 38,
     1125  "&&" => 39,
     1126  "||" => 40,
     1127  "?" => 41,
     1128  ":" => 42,
     1129  "=" => 43,
     1130  "+=" => 44,
     1131  "-=" => 45,
     1132  "*=" => 46,
     1133  "/=" => 47,
     1134  "%=" => 48,
     1135  "<<=" => 49,
     1136  ">>=" => 50,
     1137  "&=" => 51,
     1138  "|=" => 52,
     1139  "^=" => 53,
     1140  ";" => 54,
     1141  :EXTERN => 55,
     1142  :STATIC => 56,
     1143  :AUTO => 57,
     1144  :REGISTER => 58,
     1145  :VOID => 59,
     1146  :CHAR => 60,
     1147  :SHORT => 61,
     1148  :INT => 62,
     1149  :LONG => 63,
     1150  :FLOAT => 64,
     1151  :DOUBLE => 65,
     1152  :SIGNED => 66,
     1153  :UNSIGNED => 67,
     1154  :BOOL => 68,
     1155  :TYPE_NAME => 69,
     1156  :STRUCT => 70,
     1157  :UNION => 71,
     1158  :ENUM => 72,
     1159  :CONST => 73,
     1160  :RESTRICT => 74,
     1161  :VOLATILE => 75,
     1162  :__INLINE__ => 76,
     1163  :INLINE => 77,
     1164  :__INLINE => 78,
     1165  :CINLINE => 79,
     1166  :C_EXP => 80,
     1167  :EXTENSION => 81,
     1168  :TYPEDEF => 82,
     1169  :CASE => 83,
     1170  :DEFAULT => 84,
     1171  :IF => 85,
     1172  :ELSE => 86,
     1173  :SWITCH => 87,
     1174  :WHILE => 88,
     1175  :DO => 89,
     1176  :FOR => 90,
     1177  :GOTO => 91,
     1178  :CONTINUE => 92,
     1179  :BREAK => 93,
     1180  :RETURN => 94,
     1181  "::" => 95,
     1182  :_ASM => 96 }
     1183
     1184racc_nt_base = 97
    10971185
    10981186racc_use_result_var = true
     
    11321220  "\"++\"",
    11331221  "\"--\"",
     1222  "\"{\"",
     1223  "\"}\"",
    11341224  "\",\"",
    11351225  "SIZEOF",
     
    11561246  "\"?\"",
    11571247  "\":\"",
    1158   "\";\"",
    11591248  "\"=\"",
    1160   "VOID",
    1161   "FLOAT",
    1162   "DOUBLE",
    1163   "BOOL",
    1164   "TYPE_NAME",
    1165   "CHAR",
    1166   "SHORT",
    1167   "INT",
    1168   "LONG",
    1169   "SIGNED",
    1170   "UNSIGNED",
    1171   "\"{\"",
    1172   "\"}\"",
    1173   "STRUCT",
    1174   "UNION",
    1175   "ENUM",
    1176   "CONST",
    1177   "VOLATILE",
    1178   "C_EXP",
    1179   "EXTENSION",
    1180   "TYPEDEF",
    1181   "IF",
    1182   "ELSE",
    1183   "WHILE",
    1184   "DO",
    1185   "FOR",
    1186   "SWITCH",
    1187   "infunc_statment",
    1188   "CASE",
    1189   "DEFAULT",
    1190   "GOTO",
    1191   "CONTINUE",
    1192   "BREAK",
    1193   "RETURN",
    11941249  "\"+=\"",
    11951250  "\"-=\"",
     
    12021257  "\"|=\"",
    12031258  "\"^=\"",
     1259  "\";\"",
     1260  "EXTERN",
     1261  "STATIC",
     1262  "AUTO",
     1263  "REGISTER",
     1264  "VOID",
     1265  "CHAR",
     1266  "SHORT",
     1267  "INT",
     1268  "LONG",
     1269  "FLOAT",
     1270  "DOUBLE",
     1271  "SIGNED",
     1272  "UNSIGNED",
     1273  "BOOL",
     1274  "TYPE_NAME",
     1275  "STRUCT",
     1276  "UNION",
     1277  "ENUM",
     1278  "CONST",
     1279  "RESTRICT",
     1280  "VOLATILE",
    12041281  "__INLINE__",
    12051282  "INLINE",
    12061283  "__INLINE",
    12071284  "CINLINE",
    1208   "EXTERN",
    1209   "STATIC",
    1210   "AUTO",
    1211   "REGISTER",
     1285  "C_EXP",
     1286  "EXTENSION",
     1287  "TYPEDEF",
     1288  "CASE",
     1289  "DEFAULT",
     1290  "IF",
     1291  "ELSE",
     1292  "SWITCH",
     1293  "WHILE",
     1294  "DO",
     1295  "FOR",
     1296  "GOTO",
     1297  "CONTINUE",
     1298  "BREAK",
     1299  "RETURN",
    12121300  "\"::\"",
     1301  "_ASM",
    12131302  "$start",
    12141303  "all",
     
    12191308  "expression",
    12201309  "postfix_expression",
    1221   "argument_list",
     1310  "argument_expression_list",
    12221311  "type_qualifier",
     1312  "type_name",
     1313  "initializer_list",
     1314  "assignment_expression",
    12231315  "unary_expression",
    12241316  "unary_operator",
    12251317  "cast_expression",
    1226   "type_name",
    12271318  "multiplicative_expression",
    12281319  "additive_expression",
     
    12361327  "logical_or_expression",
    12371328  "conditional_expression",
     1329  "assignment_operator",
    12381330  "constant_expression",
    12391331  "declaration",
    12401332  "declaration_specifiers",
    12411333  "init_declarator_list",
    1242   "storage_class",
     1334  "storage_class_specifier",
    12431335  "type_specifier",
     1336  "function_specifier",
    12441337  "init_declarator",
    12451338  "declarator",
     
    12551348  "struct_declaration",
    12561349  "struct_declarator_list",
    1257   "type_specifier_qualifier_list",
     1350  "specifier_qualifier_list",
    12581351  "struct_declarator",
    12591352  "union_term",
     
    12631356  "union_declarator_list",
    12641357  "union_declarator",
    1265   "enum_type",
    12661358  "enumerator_list",
    12671359  "enumerator",
     
    12691361  "direct_declarator",
    12701362  "parameter_type_list",
     1363  "identifier_list",
     1364  "type_qualifier_list",
    12711365  "parameter_list",
    12721366  "parameter_declaration",
    12731367  "abstract_declarator",
    12741368  "direct_abstract_declarator",
    1275   "initializer_list",
    12761369  "extension_statement",
    1277   "statement",
     1370  "cdl_statement",
    12781371  "typedef",
    12791372  "func_def",
    12801373  "declarator_list",
    1281   "compoundstatement",
    1282   "infunc_statement_list",
    1283   "infunc_statement",
     1374  "compound_statement",
     1375  "statement",
     1376  "labeled_statement",
     1377  "expression_statement",
    12841378  "ifstatement",
    12851379  "whilestatement",
     
    12871381  "forstatement",
    12881382  "switchstatement",
    1289   "labelstatement",
    1290   "gotostatement",
    1291   "expressionstatement",
    1292   "assignment_operator" ]
     1383  "jump_statement",
     1384  "asm_statement",
     1385  "block_item_list",
     1386  "block_item" ]
    12931387
    12941388Racc_debug_parser = false
     
    13001394# reduce 1 omitted
    13011395
    1302 module_eval(<<'.,.,', 'C_parser.y.rb', 52)
     1396module_eval(<<'.,.,', 'C_parser.y.rb', 57)
    13031397  def _reduce_2(val, _values, result)
    13041398     result = [ :IDENTIFIER, val[0] ]
     
    13071401.,.,
    13081402
    1309 module_eval(<<'.,.,', 'C_parser.y.rb', 60)
     1403module_eval(<<'.,.,', 'C_parser.y.rb', 65)
    13101404  def _reduce_3(val, _values, result)
    13111405     result = [ :INTEGER_CONSTANT, val[0] ]
     
    13141408.,.,
    13151409
    1316 module_eval(<<'.,.,', 'C_parser.y.rb', 62)
     1410module_eval(<<'.,.,', 'C_parser.y.rb', 67)
    13171411  def _reduce_4(val, _values, result)
    13181412     result = [ :FLOATING_CONSTANT, val[0] ]
     
    13211415.,.,
    13221416
    1323 module_eval(<<'.,.,', 'C_parser.y.rb', 64)
     1417module_eval(<<'.,.,', 'C_parser.y.rb', 69)
    13241418  def _reduce_5(val, _values, result)
    13251419     result = [ :OCTAL_CONSTANT, val[0] ]
     
    13281422.,.,
    13291423
    1330 module_eval(<<'.,.,', 'C_parser.y.rb', 66)
     1424module_eval(<<'.,.,', 'C_parser.y.rb', 71)
    13311425  def _reduce_6(val, _values, result)
    13321426     result = [ :HEX_CONSTANT, val[0] ]
     
    13351429.,.,
    13361430
    1337 module_eval(<<'.,.,', 'C_parser.y.rb', 68)
     1431module_eval(<<'.,.,', 'C_parser.y.rb', 73)
    13381432  def _reduce_7(val, _values, result)
    13391433     result = [ :CHARACTER_LITERAL, val[0] ]
     
    13421436.,.,
    13431437
    1344 module_eval(<<'.,.,', 'C_parser.y.rb', 70)
     1438module_eval(<<'.,.,', 'C_parser.y.rb', 75)
    13451439  def _reduce_8(val, _values, result)
    13461440     result = [ :STRING_LITERAL_LIST, val[0] ]
     
    13491443.,.,
    13501444
    1351 module_eval(<<'.,.,', 'C_parser.y.rb', 72)
     1445module_eval(<<'.,.,', 'C_parser.y.rb', 77)
    13521446  def _reduce_9(val, _values, result)
    13531447     result = [ :PARENTHESES, val[1].get_elements ]
     
    13561450.,.,
    13571451
    1358 module_eval(<<'.,.,', 'C_parser.y.rb', 76)
     1452module_eval(<<'.,.,', 'C_parser.y.rb', 81)
    13591453  def _reduce_10(val, _values, result)
    13601454     result = [val[0]]
     
    13631457.,.,
    13641458
    1365 module_eval(<<'.,.,', 'C_parser.y.rb', 78)
     1459module_eval(<<'.,.,', 'C_parser.y.rb', 83)
    13661460  def _reduce_11(val, _values, result)
    13671461     result << val[1]
     
    13721466# reduce 12 omitted
    13731467
    1374 # reduce 13 omitted
     1468module_eval(<<'.,.,', 'C_parser.y.rb', 89)
     1469  def _reduce_13(val, _values, result)
     1470     result = [ :OP_SUBSC, val[0], val[2] ]
     1471    result
     1472  end
     1473.,.,
    13751474
    13761475# reduce 14 omitted
    13771476
    1378 module_eval(<<'.,.,', 'C_parser.y.rb', 86)
    1379   def _reduce_15(val, _values, result)
    1380      result = [ :OP_SUBSC, val[0], val[2] ]
    1381     result
    1382   end
    1383 .,.,
    1384 
    1385 module_eval(<<'.,.,', 'C_parser.y.rb', 88)
    1386   def _reduce_16(val, _values, result)
     1477# reduce 15 omitted
     1478
     1479# reduce 16 omitted
     1480
     1481module_eval(<<'.,.,', 'C_parser.y.rb', 94)
     1482  def _reduce_17(val, _values, result)
    13871483     result = [ :OP_DOT, val[0], val[2] ]
    13881484    result
     
    13901486.,.,
    13911487
    1392 module_eval(<<'.,.,', 'C_parser.y.rb', 90)
    1393   def _reduce_17(val, _values, result)
     1488module_eval(<<'.,.,', 'C_parser.y.rb', 96)
     1489  def _reduce_18(val, _values, result)
    13941490     result = [ :OP_REF, val[0], val[2] ]
    13951491    result
     
    13971493.,.,
    13981494
    1399 module_eval(<<'.,.,', 'C_parser.y.rb', 91)
    1400   def _reduce_18(val, _values, result)
    1401      result = val[0]
    1402     result
    1403   end
    1404 .,.,
    1405 
    1406 module_eval(<<'.,.,', 'C_parser.y.rb', 92)
     1495module_eval(<<'.,.,', 'C_parser.y.rb', 97)
    14071496  def _reduce_19(val, _values, result)
    14081497     result = val[0]
     
    14111500.,.,
    14121501
    1413 # reduce 20 omitted
     1502module_eval(<<'.,.,', 'C_parser.y.rb', 98)
     1503  def _reduce_20(val, _values, result)
     1504     result = val[0]
     1505    result
     1506  end
     1507.,.,
    14141508
    14151509# reduce 21 omitted
     
    14191513# reduce 23 omitted
    14201514
    1421 module_eval(<<'.,.,', 'C_parser.y.rb', 104)
    1422   def _reduce_24(val, _values, result)
     1515# reduce 24 omitted
     1516
     1517# reduce 25 omitted
     1518
     1519module_eval(<<'.,.,', 'C_parser.y.rb', 111)
     1520  def _reduce_26(val, _values, result)
    14231521     result = [ val[0], val[1] ]
    14241522    result
     
    14261524.,.,
    14271525
    1428 module_eval(<<'.,.,', 'C_parser.y.rb', 106)
    1429   def _reduce_25(val, _values, result)
     1526module_eval(<<'.,.,', 'C_parser.y.rb', 113)
     1527  def _reduce_27(val, _values, result)
    14301528     result = [ :OP_SIZEOF_EXPR, val[1] ]
    14311529    result
     
    14331531.,.,
    14341532
    1435 module_eval(<<'.,.,', 'C_parser.y.rb', 108)
    1436   def _reduce_26(val, _values, result)
     1533module_eval(<<'.,.,', 'C_parser.y.rb', 115)
     1534  def _reduce_28(val, _values, result)
    14371535     result = [ :OP_SIZEOF_TYPE, val[1] ]
    14381536    result
     
    14401538.,.,
    14411539
    1442 module_eval(<<'.,.,', 'C_parser.y.rb', 109)
    1443   def _reduce_27(val, _values, result)
     1540module_eval(<<'.,.,', 'C_parser.y.rb', 116)
     1541  def _reduce_29(val, _values, result)
    14441542     result = val[1]
    14451543    result
     
    14471545.,.,
    14481546
    1449 module_eval(<<'.,.,', 'C_parser.y.rb', 110)
    1450   def _reduce_28(val, _values, result)
     1547module_eval(<<'.,.,', 'C_parser.y.rb', 117)
     1548  def _reduce_30(val, _values, result)
    14511549     result = val[1]
    14521550    result
     
    14541552.,.,
    14551553
    1456 module_eval(<<'.,.,', 'C_parser.y.rb', 113)
    1457   def _reduce_29(val, _values, result)
     1554module_eval(<<'.,.,', 'C_parser.y.rb', 120)
     1555  def _reduce_31(val, _values, result)
    14581556     result = :OP_U_AMP
    14591557    result
     
    14611559.,.,
    14621560
    1463 module_eval(<<'.,.,', 'C_parser.y.rb', 114)
    1464   def _reduce_30(val, _values, result)
     1561module_eval(<<'.,.,', 'C_parser.y.rb', 121)
     1562  def _reduce_32(val, _values, result)
    14651563     result = :OP_U_ASTER
    14661564    result
     
    14681566.,.,
    14691567
    1470 module_eval(<<'.,.,', 'C_parser.y.rb', 115)
    1471   def _reduce_31(val, _values, result)
     1568module_eval(<<'.,.,', 'C_parser.y.rb', 122)
     1569  def _reduce_33(val, _values, result)
    14721570     result = :OP_U_PLUS
    14731571    result
     
    14751573.,.,
    14761574
    1477 module_eval(<<'.,.,', 'C_parser.y.rb', 116)
    1478   def _reduce_32(val, _values, result)
     1575module_eval(<<'.,.,', 'C_parser.y.rb', 123)
     1576  def _reduce_34(val, _values, result)
    14791577     result = :OP_U_MINUS
    14801578    result
     
    14821580.,.,
    14831581
    1484 module_eval(<<'.,.,', 'C_parser.y.rb', 117)
    1485   def _reduce_33(val, _values, result)
     1582module_eval(<<'.,.,', 'C_parser.y.rb', 124)
     1583  def _reduce_35(val, _values, result)
    14861584     result = :OP_U_TILDE
    14871585    result
     
    14891587.,.,
    14901588
    1491 module_eval(<<'.,.,', 'C_parser.y.rb', 118)
    1492   def _reduce_34(val, _values, result)
     1589module_eval(<<'.,.,', 'C_parser.y.rb', 125)
     1590  def _reduce_36(val, _values, result)
    14931591     result = :OP_U_EXCLAM
    14941592    result
     
    14961594.,.,
    14971595
    1498 # reduce 35 omitted
    1499 
    1500 module_eval(<<'.,.,', 'C_parser.y.rb', 123)
    1501   def _reduce_36(val, _values, result)
     1596# reduce 37 omitted
     1597
     1598module_eval(<<'.,.,', 'C_parser.y.rb', 130)
     1599  def _reduce_38(val, _values, result)
    15021600      result = [ :CAST, val[1], val[3] ]
    15031601    result
     
    15051603.,.,
    15061604
    1507 # reduce 37 omitted
    1508 
    1509 module_eval(<<'.,.,', 'C_parser.y.rb', 128)
    1510   def _reduce_38(val, _values, result)
     1605# reduce 39 omitted
     1606
     1607module_eval(<<'.,.,', 'C_parser.y.rb', 135)
     1608  def _reduce_40(val, _values, result)
    15111609     result = [ :OP_MULT, val[0], val[2] ] 
    15121610    result
     
    15141612.,.,
    15151613
    1516 module_eval(<<'.,.,', 'C_parser.y.rb', 130)
    1517   def _reduce_39(val, _values, result)
     1614module_eval(<<'.,.,', 'C_parser.y.rb', 137)
     1615  def _reduce_41(val, _values, result)
    15181616     result = [ :OP_DIV, val[0], val[2] ] 
    15191617    result
     
    15211619.,.,
    15221620
    1523 module_eval(<<'.,.,', 'C_parser.y.rb', 132)
    1524   def _reduce_40(val, _values, result)
     1621module_eval(<<'.,.,', 'C_parser.y.rb', 139)
     1622  def _reduce_42(val, _values, result)
    15251623     result = [ :OP_REMAIN, val[0], val[2] ] 
    15261624    result
     
    15281626.,.,
    15291627
    1530 # reduce 41 omitted
    1531 
    1532 module_eval(<<'.,.,', 'C_parser.y.rb', 137)
    1533   def _reduce_42(val, _values, result)
     1628# reduce 43 omitted
     1629
     1630module_eval(<<'.,.,', 'C_parser.y.rb', 144)
     1631  def _reduce_44(val, _values, result)
    15341632     result = [ :OP_ADD, val[0], val[2] ] 
    15351633    result
     
    15371635.,.,
    15381636
    1539 module_eval(<<'.,.,', 'C_parser.y.rb', 139)
    1540   def _reduce_43(val, _values, result)
     1637module_eval(<<'.,.,', 'C_parser.y.rb', 146)
     1638  def _reduce_45(val, _values, result)
    15411639     result = [ :OP_SUB, val[0], val[2] ] 
    15421640    result
     
    15441642.,.,
    15451643
    1546 # reduce 44 omitted
    1547 
    1548 module_eval(<<'.,.,', 'C_parser.y.rb', 144)
    1549   def _reduce_45(val, _values, result)
     1644# reduce 46 omitted
     1645
     1646module_eval(<<'.,.,', 'C_parser.y.rb', 151)
     1647  def _reduce_47(val, _values, result)
    15501648     result = [ :OP_LSFT, val[0], val[2] ] 
    15511649    result
     
    15531651.,.,
    15541652
    1555 module_eval(<<'.,.,', 'C_parser.y.rb', 146)
    1556   def _reduce_46(val, _values, result)
     1653module_eval(<<'.,.,', 'C_parser.y.rb', 153)
     1654  def _reduce_48(val, _values, result)
    15571655     result = [ :OP_RSFT, val[0], val[2] ] 
    15581656    result
     
    15601658.,.,
    15611659
    1562 # reduce 47 omitted
    1563 
    1564 module_eval(<<'.,.,', 'C_parser.y.rb', 151)
    1565   def _reduce_48(val, _values, result)
     1660# reduce 49 omitted
     1661
     1662module_eval(<<'.,.,', 'C_parser.y.rb', 158)
     1663  def _reduce_50(val, _values, result)
    15661664     result = [ :OP_LT, val[0], val[2] ] 
    15671665    result
     
    15691667.,.,
    15701668
    1571 module_eval(<<'.,.,', 'C_parser.y.rb', 153)
    1572   def _reduce_49(val, _values, result)
     1669module_eval(<<'.,.,', 'C_parser.y.rb', 160)
     1670  def _reduce_51(val, _values, result)
    15731671     result = [ :OP_GT, val[0], val[2] ] 
    15741672    result
     
    15761674.,.,
    15771675
    1578 module_eval(<<'.,.,', 'C_parser.y.rb', 155)
    1579   def _reduce_50(val, _values, result)
     1676module_eval(<<'.,.,', 'C_parser.y.rb', 162)
     1677  def _reduce_52(val, _values, result)
    15801678     result = [ :OP_LE, val[0], val[2] ] 
    15811679    result
     
    15831681.,.,
    15841682
    1585 module_eval(<<'.,.,', 'C_parser.y.rb', 157)
    1586   def _reduce_51(val, _values, result)
     1683module_eval(<<'.,.,', 'C_parser.y.rb', 164)
     1684  def _reduce_53(val, _values, result)
    15871685     result = [ :OP_GE, val[0], val[2] ] 
    15881686    result
     
    15901688.,.,
    15911689
    1592 # reduce 52 omitted
    1593 
    1594 module_eval(<<'.,.,', 'C_parser.y.rb', 162)
    1595   def _reduce_53(val, _values, result)
     1690# reduce 54 omitted
     1691
     1692module_eval(<<'.,.,', 'C_parser.y.rb', 169)
     1693  def _reduce_55(val, _values, result)
    15961694     result = [ :OP_EQ, val[0], val[2] ] 
    15971695    result
     
    15991697.,.,
    16001698
    1601 module_eval(<<'.,.,', 'C_parser.y.rb', 164)
    1602   def _reduce_54(val, _values, result)
     1699module_eval(<<'.,.,', 'C_parser.y.rb', 171)
     1700  def _reduce_56(val, _values, result)
    16031701     result = [ :OP_NE, val[0], val[2] ] 
    16041702    result
     
    16061704.,.,
    16071705
    1608 # reduce 55 omitted
    1609 
    1610 module_eval(<<'.,.,', 'C_parser.y.rb', 169)
    1611   def _reduce_56(val, _values, result)
     1706# reduce 57 omitted
     1707
     1708module_eval(<<'.,.,', 'C_parser.y.rb', 176)
     1709  def _reduce_58(val, _values, result)
    16121710     result = [ :OP_AND, val[0], val[2] ] 
    16131711    result
     
    16151713.,.,
    16161714
    1617 # reduce 57 omitted
    1618 
    1619 module_eval(<<'.,.,', 'C_parser.y.rb', 174)
    1620   def _reduce_58(val, _values, result)
     1715# reduce 59 omitted
     1716
     1717module_eval(<<'.,.,', 'C_parser.y.rb', 181)
     1718  def _reduce_60(val, _values, result)
    16211719     result = [ :OP_EOR, val[0], val[2] ] 
    16221720    result
     
    16241722.,.,
    16251723
    1626 # reduce 59 omitted
    1627 
    1628 module_eval(<<'.,.,', 'C_parser.y.rb', 179)
    1629   def _reduce_60(val, _values, result)
     1724# reduce 61 omitted
     1725
     1726module_eval(<<'.,.,', 'C_parser.y.rb', 186)
     1727  def _reduce_62(val, _values, result)
    16301728     result = [ :OP_OR, val[0], val[2] ] 
    16311729    result
     
    16331731.,.,
    16341732
    1635 # reduce 61 omitted
    1636 
    1637 module_eval(<<'.,.,', 'C_parser.y.rb', 184)
    1638   def _reduce_62(val, _values, result)
     1733# reduce 63 omitted
     1734
     1735module_eval(<<'.,.,', 'C_parser.y.rb', 191)
     1736  def _reduce_64(val, _values, result)
    16391737     result = [ :OP_LAND, val[0], val[2] ] 
    16401738    result
     
    16421740.,.,
    16431741
    1644 # reduce 63 omitted
    1645 
    1646 module_eval(<<'.,.,', 'C_parser.y.rb', 189)
    1647   def _reduce_64(val, _values, result)
     1742# reduce 65 omitted
     1743
     1744module_eval(<<'.,.,', 'C_parser.y.rb', 196)
     1745  def _reduce_66(val, _values, result)
    16481746     result = [ :OP_LOR, val[0], val[2] ] 
    16491747    result
     
    16511749.,.,
    16521750
    1653 # reduce 65 omitted
    1654 
    1655 module_eval(<<'.,.,', 'C_parser.y.rb', 194)
    1656   def _reduce_66(val, _values, result)
     1751# reduce 67 omitted
     1752
     1753module_eval(<<'.,.,', 'C_parser.y.rb', 201)
     1754  def _reduce_68(val, _values, result)
    16571755     result = [ :OP_CEX, val[0], val[2].get_elements, val[4] ] 
    16581756    result
     
    16601758.,.,
    16611759
    1662 module_eval(<<'.,.,', 'C_parser.y.rb', 201)
    1663   def _reduce_67(val, _values, result)
     1760# reduce 69 omitted
     1761
     1762# reduce 70 omitted
     1763
     1764# reduce 71 omitted
     1765
     1766# reduce 72 omitted
     1767
     1768# reduce 73 omitted
     1769
     1770# reduce 74 omitted
     1771
     1772# reduce 75 omitted
     1773
     1774# reduce 76 omitted
     1775
     1776# reduce 77 omitted
     1777
     1778# reduce 78 omitted
     1779
     1780# reduce 79 omitted
     1781
     1782# reduce 80 omitted
     1783
     1784# reduce 81 omitted
     1785
     1786module_eval(<<'.,.,', 'C_parser.y.rb', 223)
     1787  def _reduce_82(val, _values, result)
    16641788                        result = Expression.new( val[0] )
    16651789                        # result.print
     
    16691793.,.,
    16701794
    1671 module_eval(<<'.,.,', 'C_parser.y.rb', 208)
    1672   def _reduce_68(val, _values, result)
     1795module_eval(<<'.,.,', 'C_parser.y.rb', 228)
     1796  def _reduce_83(val, _values, result)
     1797                        result = Expression.new( val[2] )    # ',' の後ろを採用
     1798               
     1799    result
     1800  end
     1801.,.,
     1802
     1803module_eval(<<'.,.,', 'C_parser.y.rb', 234)
     1804  def _reduce_84(val, _values, result)
    16731805                        result = Expression.new( val[0] )
    16741806                        # result.print
     
    16851817.,.,
    16861818
    1687 # reduce 69 omitted
    1688 
    1689 module_eval(<<'.,.,', 'C_parser.y.rb', 237)
    1690   def _reduce_70(val, _values, result)
     1819# reduce 85 omitted
     1820
     1821module_eval(<<'.,.,', 'C_parser.y.rb', 261)
     1822  def _reduce_86(val, _values, result)
    16911823                        result = CIntType.new( -3 )    # storage class は無視
    16921824               
     
    16951827.,.,
    16961828
    1697 # reduce 71 omitted
    1698 
    1699 module_eval(<<'.,.,', 'C_parser.y.rb', 242)
    1700   def _reduce_72(val, _values, result)
     1829module_eval(<<'.,.,', 'C_parser.y.rb', 265)
     1830  def _reduce_87(val, _values, result)
     1831                        result = val[1]                # storage class は無視
     1832               
     1833    result
     1834  end
     1835.,.,
     1836
     1837# reduce 88 omitted
     1838
     1839module_eval(<<'.,.,', 'C_parser.y.rb', 270)
     1840  def _reduce_89(val, _values, result)
     1841                        result = val[1].merge val[0]
     1842               
     1843    result
     1844  end
     1845.,.,
     1846
     1847module_eval(<<'.,.,', 'C_parser.y.rb', 274)
     1848  def _reduce_90(val, _values, result)
    17011849                        result = CIntType.new( -3 )
    17021850                        result.set_qualifier val[0]
     
    17061854.,.,
    17071855
    1708 module_eval(<<'.,.,', 'C_parser.y.rb', 247)
    1709   def _reduce_73(val, _values, result)
    1710                         result = val[1]                # storage class は無視
    1711                
    1712     result
    1713   end
    1714 .,.,
    1715 
    1716 module_eval(<<'.,.,', 'C_parser.y.rb', 251)
    1717   def _reduce_74(val, _values, result)
    1718                         result = val[1].merge val[0]
    1719                
    1720     result
    1721   end
    1722 .,.,
    1723 
    1724 module_eval(<<'.,.,', 'C_parser.y.rb', 255)
    1725   def _reduce_75(val, _values, result)
     1856module_eval(<<'.,.,', 'C_parser.y.rb', 279)
     1857  def _reduce_91(val, _values, result)
    17261858                        val[1].set_qualifier val[0]
    1727                         result = val[1]
    1728                
    1729     result
    1730   end
    1731 .,.,
    1732 
    1733 module_eval(<<'.,.,', 'C_parser.y.rb', 262)
    1734   def _reduce_76(val, _values, result)
     1859                                                result = val[1]
     1860               
     1861    result
     1862  end
     1863.,.,
     1864
     1865# reduce 92 omitted
     1866
     1867# reduce 93 omitted
     1868
     1869module_eval(<<'.,.,', 'C_parser.y.rb', 287)
     1870  def _reduce_94(val, _values, result)
    17351871     result = [val[0]]
    17361872    result
     
    17381874.,.,
    17391875
    1740 module_eval(<<'.,.,', 'C_parser.y.rb', 264)
    1741   def _reduce_77(val, _values, result)
     1876module_eval(<<'.,.,', 'C_parser.y.rb', 289)
     1877  def _reduce_95(val, _values, result)
    17421878     result << val[2]
    17431879    result
     
    17451881.,.,
    17461882
    1747 # reduce 78 omitted
    1748 
    1749 module_eval(<<'.,.,', 'C_parser.y.rb', 269)
    1750   def _reduce_79(val, _values, result)
     1883# reduce 96 omitted
     1884
     1885module_eval(<<'.,.,', 'C_parser.y.rb', 294)
     1886  def _reduce_97(val, _values, result)
    17511887     val[0].set_initializer( val[2] )
    17521888    result
     
    17541890.,.,
    17551891
    1756 module_eval(<<'.,.,', 'C_parser.y.rb', 272)
    1757   def _reduce_80(val, _values, result)
     1892# reduce 98 omitted
     1893
     1894# reduce 99 omitted
     1895
     1896# reduce 100 omitted
     1897
     1898# reduce 101 omitted
     1899
     1900module_eval(<<'.,.,', 'C_parser.y.rb', 304)
     1901  def _reduce_102(val, _values, result)
    17581902     set_no_type_name true; result = CVoidType.new
    17591903    result
     
    17611905.,.,
    17621906
    1763 module_eval(<<'.,.,', 'C_parser.y.rb', 273)
    1764   def _reduce_81(val, _values, result)
     1907module_eval(<<'.,.,', 'C_parser.y.rb', 306)
     1908  def _reduce_103(val, _values, result)
     1909     set_no_type_name true; result = CIntType.new(-11 )
     1910    result
     1911  end
     1912.,.,
     1913
     1914module_eval(<<'.,.,', 'C_parser.y.rb', 308)
     1915  def _reduce_104(val, _values, result)
     1916     set_no_type_name true; result = CIntType.new( -2 )
     1917    result
     1918  end
     1919.,.,
     1920
     1921module_eval(<<'.,.,', 'C_parser.y.rb', 310)
     1922  def _reduce_105(val, _values, result)
     1923     set_no_type_name true; result = CIntType.new( -3 )
     1924    result
     1925  end
     1926.,.,
     1927
     1928module_eval(<<'.,.,', 'C_parser.y.rb', 312)
     1929  def _reduce_106(val, _values, result)
     1930     set_no_type_name true; result = CIntType.new( -4 )
     1931    result
     1932  end
     1933.,.,
     1934
     1935module_eval(<<'.,.,', 'C_parser.y.rb', 314)
     1936  def _reduce_107(val, _values, result)
    17651937     set_no_type_name true; result = CFloatType.new(-32)
    17661938    result
     
    17681940.,.,
    17691941
    1770 module_eval(<<'.,.,', 'C_parser.y.rb', 274)
    1771   def _reduce_82(val, _values, result)
     1942module_eval(<<'.,.,', 'C_parser.y.rb', 316)
     1943  def _reduce_108(val, _values, result)
    17721944     set_no_type_name true; result = CFloatType.new(-64)
    17731945    result
     
    17751947.,.,
    17761948
    1777 module_eval(<<'.,.,', 'C_parser.y.rb', 275)
    1778   def _reduce_83(val, _values, result)
    1779      set_no_type_name true; result = CBoolType.new
    1780     result
    1781   end
    1782 .,.,
    1783 
    1784 module_eval(<<'.,.,', 'C_parser.y.rb', 276)
    1785   def _reduce_84(val, _values, result)
    1786      set_no_type_name true; result = val[0]
    1787     result
    1788   end
    1789 .,.,
    1790 
    1791 module_eval(<<'.,.,', 'C_parser.y.rb', 277)
    1792   def _reduce_85(val, _values, result)
    1793      set_no_type_name true; result = CVoidType.new
    1794     result
    1795   end
    1796 .,.,
    1797 
    1798 module_eval(<<'.,.,', 'C_parser.y.rb', 278)
    1799   def _reduce_86(val, _values, result)
    1800      set_no_type_name true; result = CVoidType.new
    1801     result
    1802   end
    1803 .,.,
    1804 
    1805 module_eval(<<'.,.,', 'C_parser.y.rb', 279)
    1806   def _reduce_87(val, _values, result)
    1807      set_no_type_name true; result = CDefinedType.new( val[0].val )
    1808     result
    1809   end
    1810 .,.,
    1811 
    1812 module_eval(<<'.,.,', 'C_parser.y.rb', 281)
    1813   def _reduce_88(val, _values, result)
    1814      set_no_type_name true; result = CIntType.new(-11 )
    1815     result
    1816   end
    1817 .,.,
    1818 
    1819 module_eval(<<'.,.,', 'C_parser.y.rb', 282)
    1820   def _reduce_89(val, _values, result)
    1821      set_no_type_name true; result = CIntType.new( -2 )
    1822     result
    1823   end
    1824 .,.,
    1825 
    1826 module_eval(<<'.,.,', 'C_parser.y.rb', 283)
    1827   def _reduce_90(val, _values, result)
    1828      set_no_type_name true; result = CIntType.new( -3 )
    1829     result
    1830   end
    1831 .,.,
    1832 
    1833 module_eval(<<'.,.,', 'C_parser.y.rb', 284)
    1834   def _reduce_91(val, _values, result)
    1835      set_no_type_name true; result = CIntType.new( -4 )
    1836     result
    1837   end
    1838 .,.,
    1839 
    1840 module_eval(<<'.,.,', 'C_parser.y.rb', 287)
    1841   def _reduce_92(val, _values, result)
     1949module_eval(<<'.,.,', 'C_parser.y.rb', 319)
     1950  def _reduce_109(val, _values, result)
    18421951                        set_no_type_name true
    18431952                        result = CIntType.new( -3 )
     
    18481957.,.,
    18491958
    1850 module_eval(<<'.,.,', 'C_parser.y.rb', 293)
    1851   def _reduce_93(val, _values, result)
     1959module_eval(<<'.,.,', 'C_parser.y.rb', 325)
     1960  def _reduce_110(val, _values, result)
    18521961                        set_no_type_name true
    18531962                        result = CIntType.new( -3 )
     
    18581967.,.,
    18591968
    1860 module_eval(<<'.,.,', 'C_parser.y.rb', 302)
    1861   def _reduce_94(val, _values, result)
     1969module_eval(<<'.,.,', 'C_parser.y.rb', 330)
     1970  def _reduce_111(val, _values, result)
     1971     set_no_type_name true; result = CBoolType.new
     1972    result
     1973  end
     1974.,.,
     1975
     1976module_eval(<<'.,.,', 'C_parser.y.rb', 332)
     1977  def _reduce_112(val, _values, result)
     1978     set_no_type_name true; result = val[0]
     1979    result
     1980  end
     1981.,.,
     1982
     1983module_eval(<<'.,.,', 'C_parser.y.rb', 334)
     1984  def _reduce_113(val, _values, result)
     1985     set_no_type_name true; result = CVoidType.new
     1986    result
     1987  end
     1988.,.,
     1989
     1990module_eval(<<'.,.,', 'C_parser.y.rb', 336)
     1991  def _reduce_114(val, _values, result)
     1992     set_no_type_name true; result = CVoidType.new
     1993    result
     1994  end
     1995.,.,
     1996
     1997module_eval(<<'.,.,', 'C_parser.y.rb', 338)
     1998  def _reduce_115(val, _values, result)
     1999     set_no_type_name true; result = CDefinedType.new( val[0].val )
     2000    result
     2001  end
     2002.,.,
     2003
     2004module_eval(<<'.,.,', 'C_parser.y.rb', 344)
     2005  def _reduce_116(val, _values, result)
    18622006     StructType.set_define( true ) 
    18632007    result
     
    18652009.,.,
    18662010
    1867 module_eval(<<'.,.,', 'C_parser.y.rb', 305)
    1868   def _reduce_95(val, _values, result)
     2011module_eval(<<'.,.,', 'C_parser.y.rb', 347)
     2012  def _reduce_117(val, _values, result)
    18692013                        StructType.end_of_parse
    18702014                        result = val[1]
     
    18742018.,.,
    18752019
    1876 module_eval(<<'.,.,', 'C_parser.y.rb', 311)
    1877   def _reduce_96(val, _values, result)
     2020module_eval(<<'.,.,', 'C_parser.y.rb', 353)
     2021  def _reduce_118(val, _values, result)
    18782022                        result = CStructType.new()
    18792023                        StructType.set_define( true )
     
    18832027.,.,
    18842028
    1885 module_eval(<<'.,.,', 'C_parser.y.rb', 316)
    1886   def _reduce_97(val, _values, result)
     2029module_eval(<<'.,.,', 'C_parser.y.rb', 358)
     2030  def _reduce_119(val, _values, result)
    18872031                        StructType.end_of_parse
    18882032                        result = val[1]
     
    18922036.,.,
    18932037
    1894 module_eval(<<'.,.,', 'C_parser.y.rb', 322)
    1895   def _reduce_98(val, _values, result)
     2038module_eval(<<'.,.,', 'C_parser.y.rb', 364)
     2039  def _reduce_120(val, _values, result)
    18962040                        StructType.set_define( false )
    18972041                        StructType.end_of_parse
     
    19022046.,.,
    19032047
    1904 module_eval(<<'.,.,', 'C_parser.y.rb', 328)
    1905   def _reduce_99(val, _values, result)
     2048module_eval(<<'.,.,', 'C_parser.y.rb', 370)
     2049  def _reduce_121(val, _values, result)
    19062050     set_no_type_name true
    19072051    result
     
    19092053.,.,
    19102054
    1911 # reduce 100 omitted
    1912 
    1913 # reduce 101 omitted
    1914 
    1915 module_eval(<<'.,.,', 'C_parser.y.rb', 337)
    1916   def _reduce_102(val, _values, result)
     2055# reduce 122 omitted
     2056
     2057# reduce 123 omitted
     2058
     2059module_eval(<<'.,.,', 'C_parser.y.rb', 379)
     2060  def _reduce_124(val, _values, result)
    19172061                        result = CStructType.new( val[0].val )
    19182062                        set_no_type_name true
     
    19222066.,.,
    19232067
    1924 module_eval(<<'.,.,', 'C_parser.y.rb', 346)
    1925   def _reduce_103(val, _values, result)
     2068module_eval(<<'.,.,', 'C_parser.y.rb', 388)
     2069  def _reduce_125(val, _values, result)
    19262070                        val[1].each { |i|       # i: Decl
    19272071                                i.set_type( val[0] )
     
    19362080.,.,
    19372081
    1938 # reduce 104 omitted
    1939 
    1940 # reduce 105 omitted
    1941 
    1942 # reduce 106 omitted
    1943 
    1944 module_eval(<<'.,.,', 'C_parser.y.rb', 365)
    1945   def _reduce_107(val, _values, result)
     2082module_eval(<<'.,.,', 'C_parser.y.rb', 399)
     2083  def _reduce_126(val, _values, result)
     2084                        val[1].each { |i|       # i: Decl
     2085                                i.set_type( val[0] )
     2086                                i.set_kind( :MEMBER )
     2087                                i.check
     2088                                CStructType.new_member( i )
     2089                        }
     2090                        result = val[1]
     2091               
     2092    result
     2093  end
     2094.,.,
     2095
     2096# reduce 127 omitted
     2097
     2098# reduce 128 omitted
     2099
     2100module_eval(<<'.,.,', 'C_parser.y.rb', 417)
     2101  def _reduce_129(val, _values, result)
    19462102                        result = val[1].merge val[0]
    19472103               
     
    19502106.,.,
    19512107
    1952 module_eval(<<'.,.,', 'C_parser.y.rb', 369)
    1953   def _reduce_108(val, _values, result)
     2108# reduce 130 omitted
     2109
     2110module_eval(<<'.,.,', 'C_parser.y.rb', 422)
     2111  def _reduce_131(val, _values, result)
     2112                        val[1].set_qualifier val[0]
     2113                                                result = val[1]
     2114               
     2115    result
     2116  end
     2117.,.,
     2118
     2119module_eval(<<'.,.,', 'C_parser.y.rb', 427)
     2120  def _reduce_132(val, _values, result)
    19542121                        result = CIntType.new( -3 )
    19552122                        result.set_qualifier val[0]
     
    19592126.,.,
    19602127
    1961 module_eval(<<'.,.,', 'C_parser.y.rb', 374)
    1962   def _reduce_109(val, _values, result)
    1963                         val[1].set_qualifier val[0]
    1964                         result = val[1]
    1965                
    1966     result
    1967   end
    1968 .,.,
    1969 
    1970 module_eval(<<'.,.,', 'C_parser.y.rb', 380)
    1971   def _reduce_110(val, _values, result)
     2128module_eval(<<'.,.,', 'C_parser.y.rb', 433)
     2129  def _reduce_133(val, _values, result)
    19722130     result = [ val[0] ]
    19732131    result
     
    19752133.,.,
    19762134
    1977 module_eval(<<'.,.,', 'C_parser.y.rb', 382)
    1978   def _reduce_111(val, _values, result)
     2135module_eval(<<'.,.,', 'C_parser.y.rb', 435)
     2136  def _reduce_134(val, _values, result)
    19792137     result << val[2]
    19802138    result
     
    19822140.,.,
    19832141
    1984 # reduce 112 omitted
    1985 
    1986 # reduce 113 omitted
    1987 
    1988 # reduce 114 omitted
    1989 
    1990 # reduce 115 omitted
    1991 
    1992 module_eval(<<'.,.,', 'C_parser.y.rb', 399)
    1993   def _reduce_116(val, _values, result)
     2142# reduce 135 omitted
     2143
     2144# reduce 136 omitted
     2145
     2146# reduce 137 omitted
     2147
     2148# reduce 138 omitted
     2149
     2150module_eval(<<'.,.,', 'C_parser.y.rb', 452)
     2151  def _reduce_139(val, _values, result)
    19942152     set_no_type_name true
    19952153    result
     
    19972155.,.,
    19982156
    1999 # reduce 117 omitted
    2000 
    2001 # reduce 118 omitted
    2002 
    2003 # reduce 119 omitted
    2004 
    2005 # reduce 120 omitted
    2006 
    2007 # reduce 121 omitted
    2008 
    2009 # reduce 122 omitted
    2010 
    2011 # reduce 123 omitted
    2012 
    2013 # reduce 124 omitted
    2014 
    2015 # reduce 125 omitted
    2016 
    2017 # reduce 126 omitted
    2018 
    2019 # reduce 127 omitted
    2020 
    2021 # reduce 128 omitted
    2022 
    2023 module_eval(<<'.,.,', 'C_parser.y.rb', 430)
    2024   def _reduce_129(val, _values, result)
    2025      result = CEnumType.new( -1 )
    2026     result
    2027   end
    2028 .,.,
    2029 
    2030 # reduce 130 omitted
    2031 
    2032 # reduce 131 omitted
    2033 
    2034 # reduce 132 omitted
    2035 
    2036 # reduce 133 omitted
    2037 
    2038 module_eval(<<'.,.,', 'C_parser.y.rb', 446)
    2039   def _reduce_134(val, _values, result)
     2157# reduce 140 omitted
     2158
     2159# reduce 141 omitted
     2160
     2161# reduce 142 omitted
     2162
     2163# reduce 143 omitted
     2164
     2165# reduce 144 omitted
     2166
     2167# reduce 145 omitted
     2168
     2169# reduce 146 omitted
     2170
     2171# reduce 147 omitted
     2172
     2173# reduce 148 omitted
     2174
     2175# reduce 149 omitted
     2176
     2177# reduce 150 omitted
     2178
     2179# reduce 151 omitted
     2180
     2181# reduce 152 omitted
     2182
     2183# reduce 153 omitted
     2184
     2185# reduce 154 omitted
     2186
     2187# reduce 155 omitted
     2188
     2189# reduce 156 omitted
     2190
     2191# reduce 157 omitted
     2192
     2193# reduce 158 omitted
     2194
     2195# reduce 159 omitted
     2196
     2197# reduce 160 omitted
     2198
     2199# reduce 161 omitted
     2200
     2201# reduce 162 omitted
     2202
     2203module_eval(<<'.,.,', 'C_parser.y.rb', 495)
     2204  def _reduce_163(val, _values, result)
    20402205     result = :CONST
    20412206    result
     
    20432208.,.,
    20442209
    2045 module_eval(<<'.,.,', 'C_parser.y.rb', 447)
    2046   def _reduce_135(val, _values, result)
     2210# reduce 164 omitted
     2211
     2212module_eval(<<'.,.,', 'C_parser.y.rb', 498)
     2213  def _reduce_165(val, _values, result)
    20472214     result = :VOLATILE
    20482215    result
     
    20502217.,.,
    20512218
    2052 module_eval(<<'.,.,', 'C_parser.y.rb', 452)
    2053   def _reduce_136(val, _values, result)
     2219# reduce 166 omitted
     2220
     2221# reduce 167 omitted
     2222
     2223# reduce 168 omitted
     2224
     2225# reduce 169 omitted
     2226
     2227module_eval(<<'.,.,', 'C_parser.y.rb', 509)
     2228  def _reduce_170(val, _values, result)
    20542229                        val[1].set_type( val[0] )
    20552230                        result = val[1]
     
    20592234.,.,
    20602235
    2061 # reduce 137 omitted
    2062 
    2063 module_eval(<<'.,.,', 'C_parser.y.rb', 458)
    2064   def _reduce_138(val, _values, result)
     2236# reduce 171 omitted
     2237
     2238module_eval(<<'.,.,', 'C_parser.y.rb', 515)
     2239  def _reduce_172(val, _values, result)
    20652240                        result = Decl.new( val[1].val )
    20662241                        result.set_type( val[0] )
     
    20702245.,.,
    20712246
    2072 module_eval(<<'.,.,', 'C_parser.y.rb', 464)
    2073   def _reduce_139(val, _values, result)
     2247module_eval(<<'.,.,', 'C_parser.y.rb', 521)
     2248  def _reduce_173(val, _values, result)
    20742249     result = Decl.new( val[0].val )
    20752250    result
     
    20772252.,.,
    20782253
    2079 module_eval(<<'.,.,', 'C_parser.y.rb', 466)
    2080   def _reduce_140(val, _values, result)
     2254module_eval(<<'.,.,', 'C_parser.y.rb', 523)
     2255  def _reduce_174(val, _values, result)
    20812256     result = val[1]
    20822257    result
     
    20842259.,.,
    20852260
    2086 module_eval(<<'.,.,', 'C_parser.y.rb', 469)
    2087   def _reduce_141(val, _values, result)
     2261module_eval(<<'.,.,', 'C_parser.y.rb', 526)
     2262  def _reduce_175(val, _values, result)
    20882263                        val[0].set_type( CArrayType.new( val[2] ) )
    20892264                        result = val[0]
     
    20932268.,.,
    20942269
    2095 module_eval(<<'.,.,', 'C_parser.y.rb', 474)
    2096   def _reduce_142(val, _values, result)
     2270module_eval(<<'.,.,', 'C_parser.y.rb', 531)
     2271  def _reduce_176(val, _values, result)
    20972272                        val[0].set_type( CArrayType.new )
    20982273                        result = val[0]
     
    21022277.,.,
    21032278
    2104 module_eval(<<'.,.,', 'C_parser.y.rb', 479)
    2105   def _reduce_143(val, _values, result)
     2279module_eval(<<'.,.,', 'C_parser.y.rb', 536)
     2280  def _reduce_177(val, _values, result)
    21062281                #       Generator.warning( "W6001 need 'void' for no parameter"  )
    21072282                        val[0].set_type( CFuncType.new )
     
    21122287.,.,
    21132288
    2114 module_eval(<<'.,.,', 'C_parser.y.rb', 487)
    2115   def _reduce_144(val, _values, result)
     2289# reduce 178 omitted
     2290
     2291module_eval(<<'.,.,', 'C_parser.y.rb', 543)
     2292  def _reduce_179(val, _values, result)
    21162293                #       Generator.warning( "W6002 need 'void' for no parameter"  )
    21172294                        val[0].set_type( CFuncType.new )
     
    21222299.,.,
    21232300
    2124 module_eval(<<'.,.,', 'C_parser.y.rb', 494)
    2125   def _reduce_145(val, _values, result)
     2301module_eval(<<'.,.,', 'C_parser.y.rb', 550)
     2302  def _reduce_180(val, _values, result)
    21262303     result = CPtrType.new
    21272304    result
     
    21292306.,.,
    21302307
    2131 module_eval(<<'.,.,', 'C_parser.y.rb', 497)
    2132   def _reduce_146(val, _values, result)
     2308module_eval(<<'.,.,', 'C_parser.y.rb', 553)
     2309  def _reduce_181(val, _values, result)
    21332310                        result = CPtrType.new
    21342311                        result.set_qualifier( val[1] )
     
    21382315.,.,
    21392316
    2140 module_eval(<<'.,.,', 'C_parser.y.rb', 502)
    2141   def _reduce_147(val, _values, result)
     2317module_eval(<<'.,.,', 'C_parser.y.rb', 558)
     2318  def _reduce_182(val, _values, result)
    21422319                        val[1].set_type(CPtrType.new)
    21432320                        result = val[1]
     
    21472324.,.,
    21482325
    2149 module_eval(<<'.,.,', 'C_parser.y.rb', 507)
    2150   def _reduce_148(val, _values, result)
     2326module_eval(<<'.,.,', 'C_parser.y.rb', 563)
     2327  def _reduce_183(val, _values, result)
    21512328                        ptrtype = CPtrType.new
    21522329                        ptrtype.set_qualifier( val[1] )
     
    21582335.,.,
    21592336
    2160 # reduce 149 omitted
    2161 
    2162 # reduce 150 omitted
    2163 
    2164 # reduce 151 omitted
    2165 
    2166 # reduce 152 omitted
    2167 
    2168 # reduce 153 omitted
    2169 
    2170 # reduce 154 omitted
    2171 
    2172 # reduce 155 omitted
    2173 
    2174 # reduce 156 omitted
    2175 
    2176 # reduce 157 omitted
    2177 
    2178 # reduce 158 omitted
    2179 
    2180 # reduce 159 omitted
    2181 
    2182 # reduce 160 omitted
    2183 
    2184 # reduce 161 omitted
    2185 
    2186 # reduce 162 omitted
    2187 
    2188 # reduce 163 omitted
    2189 
    2190 # reduce 164 omitted
    2191 
    2192 # reduce 165 omitted
    2193 
    2194 module_eval(<<'.,.,', 'C_parser.y.rb', 571)
    2195   def _reduce_166(val, _values, result)
     2337# reduce 184 omitted
     2338
     2339# reduce 185 omitted
     2340
     2341# reduce 186 omitted
     2342
     2343# reduce 187 omitted
     2344
     2345# reduce 188 omitted
     2346
     2347# reduce 189 omitted
     2348
     2349# reduce 190 omitted
     2350
     2351# reduce 191 omitted
     2352
     2353# reduce 192 omitted
     2354
     2355# reduce 193 omitted
     2356
     2357# reduce 194 omitted
     2358
     2359# reduce 195 omitted
     2360
     2361# reduce 196 omitted
     2362
     2363# reduce 197 omitted
     2364
     2365# reduce 198 omitted
     2366
     2367# reduce 199 omitted
     2368
     2369# reduce 200 omitted
     2370
     2371# reduce 201 omitted
     2372
     2373# reduce 202 omitted
     2374
     2375# reduce 203 omitted
     2376
     2377# reduce 204 omitted
     2378
     2379module_eval(<<'.,.,', 'C_parser.y.rb', 630)
     2380  def _reduce_205(val, _values, result)
    21962381                        Generator.warning( "W6003 need 'void' for no parameter"  )
    21972382               
     
    22002385.,.,
    22012386
    2202 # reduce 167 omitted
    2203 
    2204 module_eval(<<'.,.,', 'C_parser.y.rb', 576)
    2205   def _reduce_168(val, _values, result)
     2387# reduce 206 omitted
     2388
     2389module_eval(<<'.,.,', 'C_parser.y.rb', 635)
     2390  def _reduce_207(val, _values, result)
    22062391                        Generator.warning( "W6004 need 'void' for no parameter"  )
    22072392               
     
    22102395.,.,
    22112396
    2212 # reduce 169 omitted
    2213 
    2214 module_eval(<<'.,.,', 'C_parser.y.rb', 583)
    2215   def _reduce_170(val, _values, result)
     2397# reduce 208 omitted
     2398
     2399module_eval(<<'.,.,', 'C_parser.y.rb', 642)
     2400  def _reduce_209(val, _values, result)
    22162401     result = val[0]
    22172402    result
     
    22192404.,.,
    22202405
    2221 module_eval(<<'.,.,', 'C_parser.y.rb', 585)
    2222   def _reduce_171(val, _values, result)
     2406module_eval(<<'.,.,', 'C_parser.y.rb', 644)
     2407  def _reduce_210(val, _values, result)
    22232408     result = val[1]
    22242409    result
     
    22262411.,.,
    22272412
    2228 module_eval(<<'.,.,', 'C_parser.y.rb', 587)
    2229   def _reduce_172(val, _values, result)
     2413module_eval(<<'.,.,', 'C_parser.y.rb', 646)
     2414  def _reduce_211(val, _values, result)
    22302415     result = val[1]
    22312416    result
     
    22332418.,.,
    22342419
    2235 module_eval(<<'.,.,', 'C_parser.y.rb', 589)
    2236   def _reduce_173(val, _values, result)
     2420module_eval(<<'.,.,', 'C_parser.y.rb', 648)
     2421  def _reduce_212(val, _values, result)
    22372422     result = C_EXP.new( val[2] )
    22382423    result
     
    22402425.,.,
    22412426
    2242 module_eval(<<'.,.,', 'C_parser.y.rb', 594)
    2243   def _reduce_174(val, _values, result)
     2427module_eval(<<'.,.,', 'C_parser.y.rb', 653)
     2428  def _reduce_213(val, _values, result)
    22442429                        result = [ val[0] ]
    22452430               
     
    22482433.,.,
    22492434
    2250 module_eval(<<'.,.,', 'C_parser.y.rb', 598)
    2251   def _reduce_175(val, _values, result)
     2435module_eval(<<'.,.,', 'C_parser.y.rb', 657)
     2436  def _reduce_214(val, _values, result)
    22522437                        val[0] << val[2]
    22532438                        result = val[0]
     
    22572442.,.,
    22582443
    2259 # reduce 176 omitted
    2260 
    2261 # reduce 177 omitted
    2262 
    2263 # reduce 178 omitted
    2264 
    2265 # reduce 179 omitted
    2266 
    2267 # reduce 180 omitted
    2268 
    2269 # reduce 181 omitted
    2270 
    2271 # reduce 182 omitted
    2272 
    2273 # reduce 183 omitted
    2274 
    2275 # reduce 184 omitted
    2276 
    2277 # reduce 185 omitted
    2278 
    2279 # reduce 186 omitted
    2280 
    2281 module_eval(<<'.,.,', 'C_parser.y.rb', 626)
    2282   def _reduce_187(val, _values, result)
     2444# reduce 215 omitted
     2445
     2446# reduce 216 omitted
     2447
     2448# reduce 217 omitted
     2449
     2450# reduce 218 omitted
     2451
     2452# reduce 219 omitted
     2453
     2454# reduce 220 omitted
     2455
     2456# reduce 221 omitted
     2457
     2458# reduce 222 omitted
     2459
     2460# reduce 223 omitted
     2461
     2462# reduce 224 omitted
     2463
     2464# reduce 225 omitted
     2465
     2466module_eval(<<'.,.,', 'C_parser.y.rb', 685)
     2467  def _reduce_226(val, _values, result)
    22832468                        val[2].each{ |i|
    22842469                           i.set_kind( :TYPEDEF )
     
    22912476.,.,
    22922477
    2293 module_eval(<<'.,.,', 'C_parser.y.rb', 635)
    2294   def _reduce_188(val, _values, result)
     2478module_eval(<<'.,.,', 'C_parser.y.rb', 694)
     2479  def _reduce_227(val, _values, result)
    22952480     result = [ val[0] ]
    22962481    result
     
    22982483.,.,
    22992484
    2300 module_eval(<<'.,.,', 'C_parser.y.rb', 637)
    2301   def _reduce_189(val, _values, result)
     2485module_eval(<<'.,.,', 'C_parser.y.rb', 696)
     2486  def _reduce_228(val, _values, result)
    23022487     result << val[2]
    23032488    result
     
    23052490.,.,
    23062491
    2307 # reduce 190 omitted
    2308 
    2309 # reduce 191 omitted
    2310 
    2311 # reduce 192 omitted
    2312 
    2313 # reduce 193 omitted
    2314 
    2315 # reduce 194 omitted
    2316 
    2317 # reduce 195 omitted
    2318 
    2319 # reduce 196 omitted
    2320 
    2321 # reduce 197 omitted
    2322 
    2323 # reduce 198 omitted
    2324 
    2325 # reduce 199 omitted
    2326 
    2327 # reduce 200 omitted
    2328 
    2329 # reduce 201 omitted
    2330 
    2331 # reduce 202 omitted
    2332 
    2333 # reduce 203 omitted
    2334 
    2335 # reduce 204 omitted
    2336 
    2337 # reduce 205 omitted
    2338 
    2339 # reduce 206 omitted
    2340 
    2341 # reduce 207 omitted
    2342 
    2343 # reduce 208 omitted
    2344 
    2345 # reduce 209 omitted
    2346 
    2347 # reduce 210 omitted
    2348 
    2349 # reduce 211 omitted
    2350 
    2351 # reduce 212 omitted
    2352 
    2353 # reduce 213 omitted
    2354 
    2355 # reduce 214 omitted
    2356 
    2357 # reduce 215 omitted
    2358 
    2359 # reduce 216 omitted
    2360 
    2361 # reduce 217 omitted
    2362 
    2363 # reduce 218 omitted
    2364 
    2365 # reduce 219 omitted
    2366 
    2367 # reduce 220 omitted
    2368 
    2369 # reduce 221 omitted
    2370 
    2371 # reduce 222 omitted
    2372 
    2373 # reduce 223 omitted
    2374 
    2375 # reduce 224 omitted
    2376 
    2377 # reduce 225 omitted
    2378 
    2379 # reduce 226 omitted
    2380 
    2381 # reduce 227 omitted
    2382 
    2383 # reduce 228 omitted
    2384 
    23852492# reduce 229 omitted
    23862493
     
    24052512# reduce 239 omitted
    24062513
    2407 module_eval(<<'.,.,', 'C_parser.y.rb', 718)
    2408   def _reduce_240(val, _values, result)
     2514# reduce 240 omitted
     2515
     2516# reduce 241 omitted
     2517
     2518# reduce 242 omitted
     2519
     2520# reduce 243 omitted
     2521
     2522# reduce 244 omitted
     2523
     2524# reduce 245 omitted
     2525
     2526# reduce 246 omitted
     2527
     2528# reduce 247 omitted
     2529
     2530# reduce 248 omitted
     2531
     2532# reduce 249 omitted
     2533
     2534# reduce 250 omitted
     2535
     2536# reduce 251 omitted
     2537
     2538# reduce 252 omitted
     2539
     2540# reduce 253 omitted
     2541
     2542# reduce 254 omitted
     2543
     2544# reduce 255 omitted
     2545
     2546# reduce 256 omitted
     2547
     2548# reduce 257 omitted
     2549
     2550# reduce 258 omitted
     2551
     2552# reduce 259 omitted
     2553
     2554# reduce 260 omitted
     2555
     2556# reduce 261 omitted
     2557
     2558# reduce 262 omitted
     2559
     2560# reduce 263 omitted
     2561
     2562# reduce 264 omitted
     2563
     2564module_eval(<<'.,.,', 'C_parser.y.rb', 761)
     2565  def _reduce_265(val, _values, result)
    24092566     result = NamespacePath.new( val[0].val, false )
    24102567    result
     
    24122569.,.,
    24132570
    2414 module_eval(<<'.,.,', 'C_parser.y.rb', 719)
    2415   def _reduce_241(val, _values, result)
     2571module_eval(<<'.,.,', 'C_parser.y.rb', 762)
     2572  def _reduce_266(val, _values, result)
    24162573     result = NamespacePath.new( val[1].val, true )
    24172574    result
     
    24192576.,.,
    24202577
    2421 module_eval(<<'.,.,', 'C_parser.y.rb', 721)
    2422   def _reduce_242(val, _values, result)
     2578module_eval(<<'.,.,', 'C_parser.y.rb', 764)
     2579  def _reduce_267(val, _values, result)
    24232580     result = val[0].append!( val[2].val )
     2581    result
     2582  end
     2583.,.,
     2584
     2585module_eval(<<'.,.,', 'C_parser.y.rb', 768)
     2586  def _reduce_268(val, _values, result)
     2587                while true
     2588                        # ';' が表れるまで、トークンを読み飛ばす。
     2589                        # gcc の構文拡張に対応すべきだが、単純な実装として、';' まで読み飛ばす。
     2590                        # トークン単位で読み飛ばしているので、文字列やコメント内の ';' は対象にならない。
     2591                        token = next_token
     2592                        if token[1].val == ";"
     2593                                break
     2594                        end
     2595                        # p "skip: #{token[1].val}"
     2596                end
     2597               
    24242598    result
    24252599  end
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/C_parser.y.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2018 by TOPPERS Project
    77#--
    8 #   上記著作権者は,以下の(1)(4)の条件を満たす場合に限り,本ソフトウェ
     8#   上記著作権者は,以下の(1)(4)の条件を満たす場合に限り,本ソフトウェ
    99#   ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
    1010#   変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
     
    4848# argument_expression_list(関数引数), assignment_expression(代入)がない
    4949# 式の result は、すべて配列で第一要素が識別シンボル、第二要素以下が引数
     50#
     51# 2019/3/28 長島 下記のC99の構文に近づくよう変更
     52#(読めないヘッダーファイルがあったため)
     53# http://www.quut.com/c/ANSI-C-grammar-y-1999.html
     54# 元々のコメントと合わなくなっています
    5055
    5156primary_expression
    52         : namespace_identifier
     57                : namespace_identifier
    5358                { result = [ :IDENTIFIER, val[0] ] }     #1ok
    5459#        : IDENTIFIER   # mikan namespace への対応
     
    5863#        | FALSE
    5964#               { result = [ :BOOL_CONSTANT, false ] }
    60         | INTEGER_CONSTANT
     65                | INTEGER_CONSTANT
    6166                { result = [ :INTEGER_CONSTANT, val[0] ] }
    62         | FLOATING_CONSTANT
     67                | FLOATING_CONSTANT
    6368                { result = [ :FLOATING_CONSTANT, val[0] ] }
    64         | OCTAL_CONSTANT
     69                | OCTAL_CONSTANT
    6570                { result = [ :OCTAL_CONSTANT, val[0] ] }
    66         | HEX_CONSTANT
     71                | HEX_CONSTANT
    6772                { result = [ :HEX_CONSTANT, val[0] ] }
    68         | CHARACTER_LITERAL
     73                | CHARACTER_LITERAL
    6974                { result = [ :CHARACTER_LITERAL, val[0] ] }
    70         | string_literal_list
     75                | string_literal_list
    7176                { result = [ :STRING_LITERAL_LIST, val[0] ] }
    72         | '(' expression ')'
     77                | '(' expression ')'
    7378                { result = [ :PARENTHESES, val[1].get_elements ] }
    7479
    7580string_literal_list
    76         : STRING_LITERAL
     81                : STRING_LITERAL
    7782                { result = [val[0]] }
    78         | string_literal_list STRING_LITERAL
     83                | string_literal_list STRING_LITERAL
    7984                { result << val[1] }
    8085
    8186# 関数呼び出しと後置インクリメント、デクリメント演算子がない
    8287postfix_expression
    83         : primary_expression
    84         | primary_expression '(' argument_list ')'
    85         | primary_expression type_qualifier '(' argument_list ')'    # intended __asm volatile ( "   MNEMONIC  OPERAND" );
    86         | postfix_expression '[' expression ']'
     88                : primary_expression
     89                | postfix_expression '[' expression ']'
    8790                { result = [ :OP_SUBSC, val[0], val[2] ] }
    88         | postfix_expression '.' IDENTIFIER
     91                | postfix_expression '(' ')'
     92                | postfix_expression '(' argument_expression_list ')'
     93                | postfix_expression type_qualifier '(' argument_expression_list ')'    # intended __asm volatile ( "   MNEMONIC  OPERAND" );
     94                | postfix_expression '.' IDENTIFIER
    8995                { result = [ :OP_DOT, val[0], val[2] ] }
    90         | postfix_expression '->' IDENTIFIER
     96                | postfix_expression '->' IDENTIFIER
    9197                { result = [ :OP_REF, val[0], val[2] ] }
    92         | postfix_expression '++'       { result = val[0] }   # ++, -- は無視する
    93         | postfix_expression '--'       { result = val[0] }
    94 
    95 argument_list
    96         :
    97         | expression
    98         | argument_list ',' expression
     98                | postfix_expression '++'       { result = val[0] }   # ++, -- は無視する
     99                | postfix_expression '--'       { result = val[0] }
     100                | '(' type_name ')' '{' initializer_list '}'
     101                | '(' type_name ')' '{' initializer_list ',' '}'
     102
     103argument_expression_list
     104                : assignment_expression
     105                | argument_expression_list ',' assignment_expression
    99106
    100107
    101108# 前置インクリメント、デクリメント演算子がない
    102109unary_expression
    103         : postfix_expression
    104         | unary_operator cast_expression
     110                : postfix_expression
     111                | unary_operator cast_expression
    105112                { result = [ val[0], val[1] ] }
    106         | SIZEOF unary_expression
     113                | SIZEOF unary_expression
    107114                { result = [ :OP_SIZEOF_EXPR, val[1] ] }
    108         | SIZEOF '(' type_name ')'
     115                | SIZEOF '(' type_name ')'
    109116                { result = [ :OP_SIZEOF_TYPE, val[1] ] }
    110117                | '++' unary_expression                 { result = val[1] }   # ++, -- は無視する
     
    112119
    113120unary_operator
    114         : '&'   { result = :OP_U_AMP }
    115         | '*'   { result = :OP_U_ASTER }
    116         | '+'   { result = :OP_U_PLUS }
    117         | '-'   { result = :OP_U_MINUS }
    118         | '~'   { result = :OP_U_TILDE }
    119         | '!'   { result = :OP_U_EXCLAM }
     121                : '&'   { result = :OP_U_AMP }
     122                | '*'   { result = :OP_U_ASTER }
     123                | '+'   { result = :OP_U_PLUS }
     124                | '-'   { result = :OP_U_MINUS }
     125                | '~'   { result = :OP_U_TILDE }
     126                | '!'   { result = :OP_U_EXCLAM }
    120127
    121128cast_expression
    122         : unary_expression
    123         | '(' type_name ')' cast_expression
     129                : unary_expression
     130                | '(' type_name ')' cast_expression
    124131                {  result = [ :CAST, val[1], val[3] ] }
    125132
    126133multiplicative_expression
    127         : cast_expression
    128         | multiplicative_expression '*' cast_expression
     134                : cast_expression
     135                | multiplicative_expression '*' cast_expression
    129136                { result = [ :OP_MULT, val[0], val[2] ]  }
    130         | multiplicative_expression '/' cast_expression
     137                | multiplicative_expression '/' cast_expression
    131138                { result = [ :OP_DIV, val[0], val[2] ]  }
    132         | multiplicative_expression '%' cast_expression
     139                | multiplicative_expression '%' cast_expression
    133140                { result = [ :OP_REMAIN, val[0], val[2] ]  }
    134141
    135142additive_expression
    136         : multiplicative_expression
    137         | additive_expression '+' multiplicative_expression
     143                : multiplicative_expression
     144                | additive_expression '+' multiplicative_expression
    138145                { result = [ :OP_ADD, val[0], val[2] ]  }
    139         | additive_expression '-' multiplicative_expression
     146                | additive_expression '-' multiplicative_expression
    140147                { result = [ :OP_SUB, val[0], val[2] ]  }
    141148
    142149shift_expression
    143         : additive_expression
    144         | shift_expression '<<' additive_expression
     150                : additive_expression
     151                | shift_expression '<<' additive_expression
    145152                { result = [ :OP_LSFT, val[0], val[2] ]  }
    146         | shift_expression '>>' additive_expression
     153                | shift_expression '>>' additive_expression
    147154                { result = [ :OP_RSFT, val[0], val[2] ]  }
    148155
    149156relational_expression
    150         : shift_expression
    151         | relational_expression '<' shift_expression
     157                : shift_expression
     158                | relational_expression '<' shift_expression
    152159                { result = [ :OP_LT, val[0], val[2] ]  }
    153         | relational_expression '>' shift_expression
     160                | relational_expression '>' shift_expression
    154161                { result = [ :OP_GT, val[0], val[2] ]  }
    155         | relational_expression '<=' shift_expression
     162                | relational_expression '<=' shift_expression
    156163                { result = [ :OP_LE, val[0], val[2] ]  }
    157         | relational_expression '>=' shift_expression
     164                | relational_expression '>=' shift_expression
    158165                { result = [ :OP_GE, val[0], val[2] ]  }
    159166
    160167equality_expression
    161         : relational_expression
    162         | equality_expression '==' relational_expression
     168                : relational_expression
     169                | equality_expression '==' relational_expression
    163170                { result = [ :OP_EQ, val[0], val[2] ]  }
    164         | equality_expression '!=' relational_expression
     171                | equality_expression '!=' relational_expression
    165172                { result = [ :OP_NE, val[0], val[2] ]  }
    166173
    167174and_expression
    168         : equality_expression
    169         | and_expression '&' equality_expression
     175                : equality_expression
     176                | and_expression '&' equality_expression
    170177                { result = [ :OP_AND, val[0], val[2] ]  }
    171178
    172179exclusive_or_expression
    173         : and_expression
    174         | exclusive_or_expression '^' and_expression
     180                : and_expression
     181                | exclusive_or_expression '^' and_expression
    175182                { result = [ :OP_EOR, val[0], val[2] ]  }
    176183
    177184inclusive_or_expression
    178         : exclusive_or_expression
    179         | inclusive_or_expression '|' exclusive_or_expression
     185                : exclusive_or_expression
     186                | inclusive_or_expression '|' exclusive_or_expression
    180187                { result = [ :OP_OR, val[0], val[2] ]  }
    181188
    182189logical_and_expression
    183         : inclusive_or_expression
    184         | logical_and_expression '&&' inclusive_or_expression
     190                : inclusive_or_expression
     191                | logical_and_expression '&&' inclusive_or_expression
    185192                { result = [ :OP_LAND, val[0], val[2] ]  }
    186193
    187194logical_or_expression
    188         : logical_and_expression
    189         | logical_or_expression '||' logical_and_expression
     195                : logical_and_expression
     196                | logical_or_expression '||' logical_and_expression
    190197                { result = [ :OP_LOR, val[0], val[2] ]  }
    191198
    192199conditional_expression
    193         : logical_or_expression
    194         | logical_or_expression '?' expression ':' conditional_expression
     200                : logical_or_expression
     201                | logical_or_expression '?' expression ':' conditional_expression
    195202                { result = [ :OP_CEX, val[0], val[2].get_elements, val[4] ]  }
    196203
    197 
    198 # コンマ演算子が使えない
     204assignment_expression
     205                : conditional_expression
     206                | unary_expression assignment_operator assignment_expression
     207
     208assignment_operator
     209                : '='
     210                | '+='
     211                | '-='
     212                | '*='
     213                | '/='
     214                | '%='
     215                | '<<='
     216                | '>>='
     217                | '&='
     218                | '|='
     219                | '^='
     220
    199221expression
    200         : conditional_expression
     222                : assignment_expression
    201223                {
    202224                        result = Expression.new( val[0] )
    203225                        # result.print
    204226                }
     227                | expression ',' assignment_expression
     228                {
     229                        result = Expression.new( val[2] )    # ',' の後ろを採用
     230                }
    205231
    206232constant_expression
    207         : conditional_expression
     233                : conditional_expression
    208234                {
    209235                        result = Expression.new( val[0] )
     
    218244                }
    219245
    220 
    221 
    222246# Types
    223247##########################  宣言  ##########################
     
    227251# K&Rとの違い: storage classが指定できない、型が省略できない
    228252declaration
    229         : declaration_specifiers init_declarator_list ';'
    230 #        : type_specifier_qualifier_list init_declarator_list ';'
     253                : declaration_specifiers init_declarator_list ';'
     254#        : specifier_qualifier_list init_declarator_list ';'
    231255
    232256# declaration_specifiersは関数のパラメータで使われるが、
    233 # type_specifier_qualifier_listで十分かもしれない
     257# specifier_qualifier_listで十分かもしれない
    234258
    235259declaration_specifiers
    236         : storage_class
     260                : storage_class_specifier
    237261                {
    238262                        result = CIntType.new( -3 )    # storage class は無視
    239263                }
    240         | type_specifier
    241         | type_qualifier
     264                | storage_class_specifier declaration_specifiers
     265                {
     266                        result = val[1]                # storage class は無視
     267                }
     268                | type_specifier
     269                | type_specifier declaration_specifiers
     270                {
     271                        result = val[1].merge val[0]
     272                }
     273                | type_qualifier
    242274                {
    243275                        result = CIntType.new( -3 )
    244276                        result.set_qualifier val[0]
    245277                }
    246         | storage_class declaration_specifiers
    247                 {
    248                         result = val[1]                # storage class は無視
    249                 }
    250         | type_specifier declaration_specifiers
    251                 {
    252                         result = val[1].merge val[0]
    253                 }
    254         | type_qualifier declaration_specifiers
     278                | type_qualifier declaration_specifiers
    255279                {
    256280                        val[1].set_qualifier val[0]
    257                         result = val[1]
    258                 }
    259 
     281                                                result = val[1]
     282                }
     283                | function_specifier
     284                | function_specifier declaration_specifiers
    260285
    261286init_declarator_list
    262         : init_declarator
     287                : init_declarator
    263288                { result = [val[0]] }
    264         | init_declarator_list ',' init_declarator
     289                | init_declarator_list ',' init_declarator
    265290                { result << val[2] }
    266291
    267292init_declarator
    268         : declarator
    269         | declarator '=' initializer
     293                : declarator
     294                | declarator '=' initializer
    270295                { val[0].set_initializer( val[2] ) }
    271296
     297storage_class_specifier
     298                : EXTERN
     299                | STATIC
     300                | AUTO
     301                | REGISTER
     302
    272303type_specifier
    273         : VOID  { set_no_type_name true; result = CVoidType.new }
    274         | FLOAT { set_no_type_name true; result = CFloatType.new(-32) }
    275         | DOUBLE        { set_no_type_name true; result = CFloatType.new(-64) }
    276         | BOOL  { set_no_type_name true; result = CBoolType.new }
    277         | struct_specifier      { set_no_type_name true; result = val[0] } # set_no_type_name true は struct_tag でも呼ばれる
    278         | union_specifier       { set_no_type_name true; result = CVoidType.new }  # void が宣言されたとする
    279         | enum_specifier        { set_no_type_name true; result = CVoidType.new }  # void が宣言されたとする
    280         | TYPE_NAME     { set_no_type_name true; result = CDefinedType.new( val[0].val ) }
    281 
    282         | CHAR  { set_no_type_name true; result = CIntType.new(-11 ) }
    283         | SHORT { set_no_type_name true; result = CIntType.new( -2 ) }
    284         | INT           { set_no_type_name true; result = CIntType.new( -3 ) }
    285         | LONG  { set_no_type_name true; result = CIntType.new( -4 ) }
    286         | SIGNED
     304                : VOID
     305                { set_no_type_name true; result = CVoidType.new }
     306                | CHAR
     307                { set_no_type_name true; result = CIntType.new(-11 ) }
     308                | SHORT
     309                { set_no_type_name true; result = CIntType.new( -2 ) }
     310                | INT
     311                { set_no_type_name true; result = CIntType.new( -3 ) }
     312                | LONG
     313                { set_no_type_name true; result = CIntType.new( -4 ) }
     314                | FLOAT
     315                { set_no_type_name true; result = CFloatType.new(-32) }
     316                | DOUBLE
     317                { set_no_type_name true; result = CFloatType.new(-64) }
     318                | SIGNED
    287319                {
    288320                        set_no_type_name true
     
    290322                        result.set_sign :SIGNED
    291323                }
    292         | UNSIGNED
     324                | UNSIGNED
    293325                {
    294326                        set_no_type_name true
     
    296328                        result.set_sign :UNSIGNED
    297329                }
     330                | BOOL
     331                { set_no_type_name true; result = CBoolType.new }
     332                | struct_specifier
     333                { set_no_type_name true; result = val[0] } # set_no_type_name true は struct_tag でも呼ばれる
     334                | union_specifier
     335                { set_no_type_name true; result = CVoidType.new }  # void が宣言されたとする
     336                | enum_specifier
     337                { set_no_type_name true; result = CVoidType.new }  # void が宣言されたとする
     338                | TYPE_NAME
     339                { set_no_type_name true; result = CDefinedType.new( val[0].val ) }
    298340
    299341# mikan K&Rのstruct_or_union_specifierに相当するが、unionは使えない, bit field にも対応しない
    300342struct_specifier                # mikan
    301343#        : STRUCT struct_tag '{'
    302         : struct_term struct_tag '{'
     344                : struct_term struct_tag '{'
    303345                { StructType.set_define( true )  }
    304            struct_declaration_list '}'
     346                struct_declaration_list '}'
    305347                {
    306348                        StructType.end_of_parse
     
    308350                }
    309351#        | STRUCT
    310         | struct_term
     352                | struct_term
    311353                {
    312354                        result = CStructType.new()
    313355                        StructType.set_define( true )
    314356                }
    315            '{' struct_declaration_list '}'
     357                '{' struct_declaration_list '}'
    316358                {
    317359                        StructType.end_of_parse
     
    319361                }
    320362#        | STRUCT struct_tag   # mikan struct_tag は namespace 対応が必要
    321         | struct_term struct_tag   # mikan struct_tag は namespace 対応が必要
     363                | struct_term struct_tag   # mikan struct_tag は namespace 対応が必要
    322364                {
    323365                        StructType.set_define( false )
     
    327369
    328370struct_term
    329         : STRUCT { set_no_type_name true }
     371                : STRUCT { set_no_type_name true }
    330372
    331373struct_declaration_list
    332         : struct_declaration
    333         | struct_declaration_list struct_declaration
     374                : struct_declaration
     375                | struct_declaration_list struct_declaration
    334376
    335377struct_tag:
    336         IDENTIFIER
     378                IDENTIFIER
    337379                {
    338380                        result = CStructType.new( val[0].val )
     
    342384# ポインタ修飾子を追加
    343385struct_declaration
    344         : declaration_specifiers struct_declarator_list ';'
    345 #        :                                type_specifier_qualifier_list struct_declarator_list ';'
     386                : declaration_specifiers struct_declarator_list ';'
     387#        :                                specifier_qualifier_list struct_declarator_list ';'
    346388                {
    347389                        val[1].each { |i|       # i: Decl
     
    353395                        result = val[1]
    354396                }
    355         | union_specifier ';'                       # 無名
    356         | struct_specifier ';'                       # 無名
     397                # ビットフィールドを読み飛ばし
     398                | declaration_specifiers struct_declarator_list ':' constant_expression ';'
     399                {
     400                        val[1].each { |i|       # i: Decl
     401                                i.set_type( val[0] )
     402                                i.set_kind( :MEMBER )
     403                                i.check
     404                                CStructType.new_member( i )
     405                        }
     406                        result = val[1]
     407                }
     408                | union_specifier ';'                       # 無名
     409                | struct_specifier ';'                       # 無名
    357410
    358411
     
    360413# K&Rのspecifier_qualifier_listと同じ
    361414# 名前がまぎらわしかったのでtype_を付けた
    362 type_specifier_qualifier_list
    363         : type_specifier
    364         | type_specifier type_specifier_qualifier_list
     415specifier_qualifier_list
     416                : type_specifier specifier_qualifier_list
    365417                {
    366418                        result = val[1].merge val[0]
    367419                }
    368         | type_qualifier
     420                | type_specifier
     421                | type_qualifier specifier_qualifier_list
     422                {
     423                        val[1].set_qualifier val[0]
     424                                                result = val[1]
     425                }
     426                | type_qualifier
    369427                {
    370428                        result = CIntType.new( -3 )
    371429                        result.set_qualifier val[0]
    372430                }
    373         | type_qualifier type_specifier_qualifier_list
    374                 {
    375                         val[1].set_qualifier val[0]
    376                         result = val[1]
    377                 }
    378431
    379432struct_declarator_list
    380         : struct_declarator
     433                : struct_declarator
    381434                { result = [ val[0] ] }
    382         | struct_declarator_list ',' struct_declarator
     435                | struct_declarator_list ',' struct_declarator
    383436                { result << val[2] }
    384437
    385438# ビットフィールドは使えない
    386439struct_declarator
    387         : declarator
    388 
    389 
     440                : declarator
     441#               | ':' constant_expression
     442#               | declarator ':' constant_expression
    390443
    391444union_specifier
     
    393446#        | UNION '{' union_declaration_list '}'
    394447#        | UNION union_tag   # mikan struct_tag は namespace 対応が必要
    395         : union_term union_tag '{' union_declaration_list '}'
    396         | union_term '{' union_declaration_list '}'
    397         | union_term union_tag   # mikan struct_tag は namespace 対応が必要
     448                : union_term union_tag '{' union_declaration_list '}'
     449                | union_term '{' union_declaration_list '}'
     450                | union_term union_tag   # mikan struct_tag は namespace 対応が必要
    398451
    399452union_term
    400         : UNION { set_no_type_name true }
     453                : UNION { set_no_type_name true }
    401454
    402455union_declaration_list
    403         : union_declaration
    404         | union_declaration_list union_declaration
     456                : union_declaration
     457                | union_declaration_list union_declaration
    405458
    406459union_tag:
     
    408461
    409462union_declaration
    410         : declaration_specifiers union_declarator_list ';'
     463                : declaration_specifiers union_declarator_list ';'
    411464                | union_specifier ';'                       # 無名
    412465                | struct_specifier ';'                      # 無名
    413466
    414467union_declarator_list
    415         : union_declarator
    416         | union_declarator_list ',' union_declarator
    417 
    418 # ビットフィールドは使えない
     468                : union_declarator
     469                | union_declarator_list ',' union_declarator
     470
    419471union_declarator
    420         : declarator
    421 
    422 
    423 
    424 # enumの種類を追加
    425 enum_specifier          # mikan
    426         : enum_type            '{' enumerator_list '}'
    427         | enum_type IDENTIFIER '{' enumerator_list '}'
    428         | enum_type IDENTIFIER
    429 
    430 enum_type
    431         : ENUM  { result = CEnumType.new( -1 ) }
    432 #        | ENUM8        { result = CEnumType.new( 8 ) }
    433 #        | ENUM16       { result = CEnumType.new( 16 ) }
    434 #        | ENUM32       { result = CEnumType.new( 32 ) }
    435 #        | ENUM64       { result = CEnumType.new( 64 ) }
    436 #        | ENUM128      { result = CEnumType.new( 128 ) }
     472                : declarator
     473                | ':' constant_expression
     474                | declarator ':' constant_expression
     475
     476enum_specifier
     477                : ENUM '{' enumerator_list '}'
     478                | ENUM IDENTIFIER '{' enumerator_list '}'
     479                | ENUM '{' enumerator_list ',' '}'
     480                | ENUM IDENTIFIER '{' enumerator_list ',' '}'
     481                | ENUM IDENTIFIER
     482                | ENUM TYPE_NAME '{' enumerator_list '}'
     483                | ENUM TYPE_NAME '{' enumerator_list ',' '}'
     484                | ENUM TYPE_NAME
    437485
    438486enumerator_list
    439         : enumerator
    440         | enumerator_list ',' enumerator
     487                : enumerator
     488                | enumerator_list ',' enumerator
    441489
    442490enumerator
    443         : IDENTIFIER
    444         | IDENTIFIER '=' constant_expression
     491                : IDENTIFIER
     492                | IDENTIFIER '=' constant_expression
    445493
    446494type_qualifier
    447         : CONST { result = :CONST }
    448         | VOLATILE      { result = :VOLATILE }
     495                : CONST
     496                { result = :CONST }
     497                | RESTRICT
     498                | VOLATILE
     499                { result = :VOLATILE }
     500
     501function_specifier
     502                : __INLINE__
     503                | INLINE
     504                | __INLINE
     505                | CINLINE
    449506
    450507declarator
    451         : pointer direct_declarator
     508                : pointer direct_declarator
    452509                {
    453510                        val[1].set_type( val[0] )
    454511                        result = val[1]
    455512                }
    456         | direct_declarator
    457         | pointer TYPE_NAME     # 関数ポインタの typedef が二重定義の場合
     513                | direct_declarator
     514                | pointer TYPE_NAME     # 関数ポインタの typedef が二重定義の場合
    458515                {
    459516                        result = Decl.new( val[1].val )
     
    462519
    463520direct_declarator               # mikan
    464         : IDENTIFIER
     521                : IDENTIFIER
    465522                { result = Decl.new( val[0].val ) }
    466         | '(' declarator ')'
     523                | '(' declarator ')'
    467524                { result = val[1] }
    468         | direct_declarator '[' constant_expression ']'
     525                | direct_declarator '[' constant_expression ']'
    469526                {
    470527                        val[0].set_type( CArrayType.new( val[2] ) )
    471528                        result = val[0]
    472529                }
    473         | direct_declarator '[' ']'
     530                | direct_declarator '[' ']'
    474531                {
    475532                        val[0].set_type( CArrayType.new )
    476533                        result = val[0]
    477534                }
    478         | direct_declarator '(' parameter_type_list ')'
     535                | direct_declarator '(' parameter_type_list ')'
    479536                {
    480537                #       Generator.warning( "W6001 need 'void' for no parameter"  )
     
    482539                        result = val[0]
    483540                }
    484 
    485 #        | direct_declarator '(' identifier_list ')'  # これは何のために必要? 060211
    486         | direct_declarator '(' ')'
     541                | direct_declarator '(' identifier_list ')'  # これは何のために必要? 060211
     542                | direct_declarator '(' ')'
    487543                {
    488544                #       Generator.warning( "W6002 need 'void' for no parameter"  )
     
    492548
    493549pointer
    494         : '*'
     550                : '*'
    495551                { result = CPtrType.new }
    496         | '*' type_qualifier
     552                | '*' type_qualifier_list
    497553                {
    498554                        result = CPtrType.new
    499555                        result.set_qualifier( val[1] )
    500556                }
    501         | '*' pointer
     557                | '*' pointer
    502558                {
    503559                        val[1].set_type(CPtrType.new)
    504560                        result = val[1]
    505561                }
    506         | '*' type_qualifier pointer
     562                | '*' type_qualifier_list pointer
    507563                {
    508564                        ptrtype = CPtrType.new
     
    512568                }
    513569
     570type_qualifier_list
     571                : type_qualifier
     572                | type_qualifier_list type_qualifier
    514573
    515574parameter_type_list
    516         : parameter_list
    517         | parameter_list ',' '.' '.' '.'
     575                : parameter_list
     576                | parameter_list ',' '.' '.' '.'
    518577                # mikan 可変長パラメータ,  ... の間のスペースが許される(手抜き)
    519578
    520579parameter_list
    521         : parameter_declaration
     580                : parameter_declaration
    522581#               { result = ParamList.new( val[0] ) }
    523         | parameter_list ',' parameter_declaration
     582                | parameter_list ',' parameter_declaration
    524583#               {
    525584#                       val[0].add_param( val[2] )
     
    530589# パラメータ修飾子を追加
    531590parameter_declaration
    532         : declaration_specifiers declarator
     591                : declaration_specifiers declarator
    533592#               {
    534593#                       decl = ParamDecl.new( val[1], val[0], [] )
     
    545604#                       result = nil
    546605#               }
    547         | declaration_specifiers abstract_declarator    # 仮引数なし
    548         | declaration_specifiers                                                # 仮引数なし
    549 
    550 
    551 #identifier_list       # 060211  不用になった
    552 #        : IDENTIFIER
    553 #        | identifier_list ',' IDENTIFIER
     606                | declaration_specifiers abstract_declarator    # 仮引数なし
     607                | declaration_specifiers                                                # 仮引数なし
     608
     609
     610identifier_list       # 060211  不用になった
     611        : IDENTIFIER
     612        | identifier_list ',' IDENTIFIER
    554613
    555614type_name
    556         : type_specifier_qualifier_list
    557         | type_specifier_qualifier_list abstract_declarator
     615                : specifier_qualifier_list
     616                | specifier_qualifier_list abstract_declarator
    558617
    559618abstract_declarator             # mikan
    560         : pointer
    561         | direct_abstract_declarator
    562         | pointer direct_abstract_declarator
     619                : pointer
     620                | direct_abstract_declarator
     621                | pointer direct_abstract_declarator
    563622
    564623direct_abstract_declarator
    565         : '(' abstract_declarator ')'
    566         | '[' ']'
    567         | '[' constant_expression ']'
    568         | direct_abstract_declarator '[' ']'
    569         | direct_abstract_declarator '[' constant_expression ']'
    570         | '(' ')'
     624                : '(' abstract_declarator ')'
     625                | '[' ']'
     626                | '[' assignment_expression ']'
     627                | direct_abstract_declarator '[' ']'
     628                | direct_abstract_declarator '[' assignment_expression ']'
     629                | '(' ')'
    571630                {
    572631                        Generator.warning( "W6003 need 'void' for no parameter"  )
    573632                }
    574         | '(' parameter_type_list ')'
    575         | direct_abstract_declarator '(' ')'
     633                | '(' parameter_type_list ')'
     634                | direct_abstract_declarator '(' ')'
    576635                {
    577636                        Generator.warning( "W6004 need 'void' for no parameter"  )
    578637                }
    579         | direct_abstract_declarator '(' parameter_type_list ')'
     638                | direct_abstract_declarator '(' parameter_type_list ')'
    580639
    581640# assignment_expressionをconstant_expressionに変更
    582641initializer                     # mikan
    583         : constant_expression
     642                : assignment_expression
    584643                { result = val[0] }
    585         | '{' initializer_list '}'
     644                | '{' initializer_list '}'
    586645                { result = val[1] }
    587         | '{' initializer_list ',' '}'
     646                | '{' initializer_list ',' '}'
    588647                { result = val[1] }
    589         | C_EXP '(' STRING_LITERAL ')'
     648                | C_EXP '(' STRING_LITERAL ')'
    590649                { result = C_EXP.new( val[2] ) }
    591650
    592651initializer_list
    593         : initializer
     652                : initializer
    594653                {
    595654                        result = [ val[0] ]
    596655                }
    597         | initializer_list ',' initializer
     656                | initializer_list ',' initializer
    598657                {
    599658                        val[0] << val[2]
     
    606665#トップレベルの構文規則
    607666C_parser
    608         :
    609         | C_parser extension_statement
     667                :
     668                | C_parser extension_statement
    610669
    611670extension_statement
    612         : statement
    613         | EXTENSION statement
    614 
    615 statement
    616         : typedef
    617         | func_def
    618         | enum_specifier ';'
    619         | struct_specifier ';'
    620         | declaration
    621         | ';'
    622         | error   # エラー回復ポイント
     671                : cdl_statement
     672                | EXTENSION cdl_statement
     673
     674cdl_statement
     675                : typedef
     676                | func_def
     677                | enum_specifier ';'
     678                | struct_specifier ';'
     679                | declaration
     680                | ';'
     681                | error   # エラー回復ポイント
    623682
    624683typedef
    625         : TYPEDEF type_specifier_qualifier_list declarator_list ';'
     684        : TYPEDEF specifier_qualifier_list declarator_list ';'
    626685                {
    627686                        val[2].each{ |i|
     
    633692
    634693declarator_list
    635         : declarator
     694                : declarator
    636695                { result = [ val[0] ] }
    637         | declarator_list ',' declarator
     696                | declarator_list ',' declarator
    638697                { result << val[2] }
    639698
    640699func_def
    641         : declaration_specifiers declarator compoundstatement
    642 
    643 infunc_statement_list
    644         :
    645         | infunc_statement_list infunc_statement
    646 
    647 infunc_statement
    648         : declaration
    649         | ifstatement
    650         | whilestatement
    651         | dowhilestatement
    652         | forstatement
    653         | switchstatement
    654         | labelstatement
    655         | compoundstatement
    656         | gotostatement
    657         | expressionstatement
    658         | ';'
     700                : declaration_specifiers declarator compound_statement
     701
     702statement
     703                : labeled_statement
     704                | compound_statement
     705                | expression_statement
     706                | ifstatement
     707                | whilestatement
     708                | dowhilestatement
     709                | forstatement
     710                | switchstatement
     711                | jump_statement
     712                | asm_statement
     713
     714labeled_statement
     715                : IDENTIFIER ':' statement
     716                | CASE constant_expression ':' statement
     717                | DEFAULT ':' statement
     718
     719compound_statement
     720                : '{' '}'
     721                | '{' block_item_list '}'
     722
     723block_item_list
     724                : block_item
     725                | block_item_list block_item
     726
     727block_item
     728                : declaration
     729                | statement
     730
     731expression_statement
     732                : ';'
     733                | expression ';'
    659734
    660735ifstatement
    661         : IF '(' expression ')' infunc_statement
    662         | IF '(' expression ')' infunc_statement ELSE infunc_statement
     736                : IF '(' expression ')' statement
     737                | IF '(' expression ')' statement ELSE statement
     738
     739switchstatement
     740                : SWITCH '(' expression ')' compound_statement
    663741
    664742whilestatement
    665         : WHILE '(' expression ')' infunc_statement
     743                : WHILE '(' expression ')' statement
    666744
    667745dowhilestatement
    668         : DO infunc_statement WHILE '(' expression ')' ';'
     746                : DO statement WHILE '(' expression ')' ';'
    669747
    670748forstatement
    671         : FOR '(' expression ';' expression ';' expression ')' infunc_statement
    672 
    673 switchstatement
    674         : SWITCH '(' expression ')'  infunc_statment
    675 
    676 labelstatement
    677         : IDENTIFIER ':' infunc_statement
    678         | CASE constant_expression ':' infunc_statement
    679         | DEFAULT ':' infunc_statement
    680 
    681 compoundstatement
    682         : '{' infunc_statement_list '}'
    683 
    684 gotostatement
    685         : GOTO IDENTIFIER ';'
    686         | CONTINUE ';'
    687         | BREAK ';'
    688         | RETURN expression ';'
    689         | RETURN ';'
    690 
    691 expressionstatement
    692         : expression ';'
    693         | unary_expression assignment_operator expression ';'
    694 
    695 assignment_operator
    696         : '='
    697         | '+='
    698         | '-='
    699         | '*='
    700         | '/='
    701         | '%='
    702         | '<<='
    703         | '>>='
    704         | '&='
    705         | '|='
    706         | '^='
    707 
    708 storage_class
    709         : __INLINE__
    710         | INLINE
    711         | __INLINE
    712         | CINLINE
    713         | EXTERN
    714         | STATIC
    715         | AUTO
    716         | REGISTER
     749                : FOR '(' expression_statement expression_statement ')' statement
     750                | FOR '(' expression_statement expression_statement expression ')' statement
     751                | FOR '(' declaration expression_statement ')' statement
     752                | FOR '(' declaration expression_statement expression ')' statement
     753
     754jump_statement
     755                : GOTO IDENTIFIER ';'
     756                | CONTINUE ';'
     757                | BREAK ';'
     758                | RETURN ';'
     759                | RETURN expression ';'
    717760
    718761namespace_identifier
    719         : IDENTIFIER            { result = NamespacePath.new( val[0].val, false ) }
    720         | '::' IDENTIFIER       { result = NamespacePath.new( val[1].val, true ) }
    721         | namespace_identifier '::' IDENTIFIER
     762                : IDENTIFIER            { result = NamespacePath.new( val[0].val, false ) }
     763                | '::' IDENTIFIER       { result = NamespacePath.new( val[1].val, true ) }
     764                | namespace_identifier '::' IDENTIFIER
    722765                { result = val[0].append!( val[2].val ) }
    723766
     767asm_statement
     768                : _ASM {
     769                while true
     770                        # ';' が表れるまで、トークンを読み飛ばす。
     771                        # gcc の構文拡張に対応すべきだが、単純な実装として、';' まで読み飛ばす。
     772                        # トークン単位で読み飛ばしているので、文字列やコメント内の ';' は対象にならない。
     773                        token = next_token
     774                        if token[1].val == ";"
     775                                break
     776                        end
     777                        # p "skip: #{token[1].val}"
     778                end
     779                }
     780
    724781end
    725782
    726783---- inner
    727784
    728   RESERVED = {
    729     # keyword
    730     'typedef' => :TYPEDEF,
    731     'struct' => :STRUCT,
    732     'union' => :UNION,
    733     'sizeof' => :SIZEOF,
    734     'throw' => :THROW,
    735 
    736     # specifier
    737     # types
    738     'void'    => :VOID,
    739     'char'    => :CHAR,
    740     'short'   => :SHORT,
    741 
    742     'volatile'=> :VOLATILE,
    743     'const'   => :CONST,
    744     'extern'   => :EXTERN,
    745 
    746     'long'    => :LONG,
    747     'float'   => :FLOAT,
    748     'double'  => :DOUBLE,
    749     'signed'  => :SIGNED,
    750     'unsigned'=> :UNSIGNED,
    751 
    752     'int'     => :INT,
    753     'enum'    => :ENUM,
    754 
    755     'if'      => :IF,
    756     'else'    => :ELSE,
    757     'while'   => :WHILE,
    758     'do'      => :DO,
    759     'for'     => :FOR,
    760     'case'    => :CASE,
    761     'default' => :DEFAULT,
    762     'goto'    => :GOTO,
    763     'continue' => :CONTINUE,
    764     'break'   => :BREAK,
    765     'return'  => :RETURN,
    766     '__inline__'  => :__INLINE__,
    767     'inline'  => :INLINE,
    768     '__inline'  => :__INLINE,
    769     'Inline'  => :CINLINE,        # inline starting with Capital letter
    770     'static'  => :STATIC,
    771     'register' => :REGISTER,
    772     'auto'    => :AUTO,
    773     '__extension__'    => :EXTENSION,
    774 
    775   }
    776 
    777   @@generator_nest = -1
    778   @@generator_stack = []
    779   @@current_locale = []
    780 
    781   def finalize
    782 
    783     # mikan Namespace.pop
    784     Celltype.pop
    785     Cell.pop
    786     CompositeCelltype.pop
    787     Region.pop
    788 
    789   end
    790 
    791   def set_plugin( plugin )
    792     @plugin = plugin
    793   end
    794 
    795   def self.get_plugin
    796     @@generator_stack[@@generator_nest].get_plugin
    797   end
    798 
    799   def get_plugin
    800     @plugin
    801   end
    802 
    803   def parse(files)
    804 
    805     # mikan Namespace.push
    806     Celltype.push
    807     Cell.push
    808     CompositeCelltype.push
    809     Region.push
    810 
    811     @@generator_nest += 1
    812     @@generator_stack[@@generator_nest] = self
    813     @b_no_type_name = false
    814 
    815    begin
    816 
    817     @q = []
    818     comment = false
    819 
    820     # euc のコメントを utf8 として扱うと、コメントの終わりを誤る問題の対策
    821     TECS_LANG::set_kcode_binary
    822 
    823     # 800U, 0xffLL など (整数リテラルに共通の修飾子)
    824     integer_qualifier = "([Uu][Ll][Ll]|[Uu][Ll]|[Uu]|[Ll][Ll]|[Ll])?"
    825 
    826     files.each {|file|
    827       lineno = 1
    828      begin
    829 #2.0       IO.foreach(file) {|line|
    830        TECSIO.foreach(file) {|line|
    831         col = 1
    832         line.rstrip!
    833 
    834         until line.empty?
    835 
    836           if comment
    837             case line
    838             # コメント終了
    839             when /\A\*\//
    840               comment = false
    841             when /\A./
    842               ;
    843             end
    844           else
    845             case line
    846             # 空白、プリプロセスディレクティブ
    847             when /\A\s+/
    848               ;
    849             # 識別子
    850             when /\A[a-zA-Z_]\w*/
    851               word = $&
    852               @q << [RESERVED[word] || :IDENTIFIER, Token.new(word.intern, file, lineno, col)]
    853             # 16 進数定数
    854             when /\A0x[0-9A-Fa-f]+#{integer_qualifier}/
    855               @q << [:HEX_CONSTANT, Token.new($&, file, lineno, col)]
    856             # 8 進数定数
    857             when /\A0[0-7]+#{integer_qualifier}/
    858               @q << [:OCTAL_CONSTANT, Token.new($&, file, lineno, col)]
    859             # 浮動小数定数
    860             when /\A[0-9]+\.([0-9]*)?([Ee][+-]?[0-9]+)?/
    861               @q << [:FLOATING_CONSTANT, Token.new($&, file, lineno, col)]
    862             # 整数定数
    863             when /\A\d+#{integer_qualifier}/
    864             # when /\A\d+/
    865               @q << [:INTEGER_CONSTANT, Token.new($&.to_i, file, lineno, col)]
    866             # 文字
    867             when /\A'(?:[^'\\]|\\.)'/
    868               @q << [:CHARACTER_LITERAL, Token.new($&, file, lineno, col)]
    869             # 文字列
    870 #              "#include  #include #include \"../systask/logtask.cfg\"       最後の " 忘れ)で無限ループ
    871 #            when /\A"(?:[^"\\]+|\\.)*"/
    872             when /\A"(?:[^"\\]|\\.)*"/   # これはうまく行くようだ
    873               @q << [:STRING_LITERAL, Token.new($&, file, lineno, col)]
    874             # 行コメント
    875             when /\A\/\/.*$/
    876               # 読み飛ばすだけ
    877             # コメント開始
    878             when /\A\/\*/
    879               comment = true
    880             when /\A>>=/, /\A<<=/, /\A>>/,  /\A<</
    881               @q << [$&, Token.new($&, file, lineno, col)]
    882             when /\A\+=/, /\A\-=/, /\A\*=/, /\A\/=/, /\A%=/, /\A&=/, /\A\|=/, /\A\^=/
    883               @q << [$&, Token.new($&, file, lineno, col)]
    884             when /\A::/, /\A==/, /\A!=/, /\A>=/, /\A<=/, /\A\->/, /\A\+\+/, /\A\-\-/
    885               @q << [$&, Token.new($&, file, lineno, col)]
    886             when /\A./
    887               @q << [$&, Token.new($&, file, lineno, col)]
    888             else
    889               raise
    890             end
    891           end
    892 
    893           line = $'
    894           col += $&.length
    895         end
    896 
    897         lineno += 1
    898       }
    899 
    900      rescue => evar
    901        Generator.error( "B1002 while open or reading \'$1\'" , file )
    902        print_exception( evar )
    903      end
    904     }
    905 
    906     # 終了の印
    907     @q << nil
    908 
    909     @yydebug = true
    910     do_parse
    911 
    912    ensure
    913     @@generator_nest -= 1
    914     TECS_LANG::reset_kcode
    915    end
    916 
    917   end
    918 
    919 
    920   def next_token
    921     token = @q.shift
    922 
    923     if token then
    924       @@current_locale[@@generator_nest] = token[1].locale
    925 
    926       case token[1].val
    927       when ";", ":", ",", "(", ")", "{", "}"
    928         set_no_type_name false
    929       when ".", "->"
    930         set_no_type_name true
    931       end
    932 
    933       # TYPE_NAME トークンへ置き換え
    934       if @b_no_type_name == false
    935         if token[0] == :IDENTIFIER && Namespace.is_typename?( token[1].val ) then
    936           token[0] = :TYPE_NAME
    937           locale = @@current_locale[@@generator_nest]
     785        RESERVED = {
     786                # keyword
     787                'typedef' => :TYPEDEF,
     788                'struct' => :STRUCT,
     789                'union' => :UNION,
     790                'sizeof' => :SIZEOF,
     791                'throw' => :THROW,
     792
     793                # specifier
     794                # types
     795                'void'    => :VOID,
     796                'char'    => :CHAR,
     797                'short'   => :SHORT,
     798
     799                'volatile'=> :VOLATILE,
     800                'restrict'=> :RESTRICT,
     801                'const'   => :CONST,
     802                'extern'   => :EXTERN,
     803
     804                'long'    => :LONG,
     805                'float'   => :FLOAT,
     806                'double'  => :DOUBLE,
     807                'signed'  => :SIGNED,
     808                'unsigned'=> :UNSIGNED,
     809
     810                'int'     => :INT,
     811                'enum'    => :ENUM,
     812
     813                'if'      => :IF,
     814                'else'    => :ELSE,
     815                'while'   => :WHILE,
     816                'do'      => :DO,
     817                'for'     => :FOR,
     818                'switch'  => :SWITCH,
     819                'case'    => :CASE,
     820                'default' => :DEFAULT,
     821                'goto'    => :GOTO,
     822                'continue' => :CONTINUE,
     823                'break'   => :BREAK,
     824                'return'  => :RETURN,
     825                '__inline__'  => :__INLINE__,
     826                'inline'  => :INLINE,
     827                '__inline'  => :__INLINE,
     828                'Inline'  => :CINLINE,        # inline starting with Capital letter
     829                'static'  => :STATIC,
     830                'register' => :REGISTER,
     831                'auto'    => :AUTO,
     832                '__extension__'    => :EXTENSION,
     833                '__asm__' => :_ASM,
     834                'asm' =>     :_ASM
     835
     836        }
     837
     838        @@generator_nest = -1
     839        @@generator_stack = []
     840        @@current_locale = []
     841
     842        def finalize
     843
     844                # mikan Namespace.pop
     845                Celltype.pop
     846                Cell.pop
     847                CompositeCelltype.pop
     848                Region.pop
     849
     850        end
     851
     852        def set_plugin( plugin )
     853                @plugin = plugin
     854        end
     855
     856        def self.get_plugin
     857                @@generator_stack[@@generator_nest].get_plugin
     858        end
     859
     860        def get_plugin
     861                @plugin
     862        end
     863
     864        def parse(files)
     865
     866                # mikan Namespace.push
     867                Celltype.push
     868                Cell.push
     869                CompositeCelltype.push
     870                Region.push
     871
     872                @@generator_nest += 1
     873                @@generator_stack[@@generator_nest] = self
     874                @b_no_type_name = false
     875
     876        begin
     877
     878                @q = []
     879                comment = false
     880#               b_asm   = false
     881
     882                # euc のコメントを utf8 として扱うと、コメントの終わりを誤る問題の対策
     883                TECS_LANG::set_kcode_binary
     884
     885                # 800U, 0xffLL など (整数リテラルに共通の修飾子)
     886                integer_qualifier = "([Uu][Ll][Ll]|[Uu][Ll]|[Uu]|[Ll][Ll]|[Ll])?"
     887
     888                files.each {|file|
     889                        lineno = 1
     890                begin
     891#2.0            IO.foreach(file) {|line|
     892                        TECSIO.foreach(file) {|line|
     893                        col = 1
     894                        line.rstrip!
     895
     896                        until line.empty?
     897
     898                                if comment
     899                                        case line
     900                                        # コメント終了
     901                                        when /\A\*\//
     902                                                comment = false
     903                                        when /\A./
     904                                                ;
     905                                        end
     906                                else
     907                                        case line
     908                                        # 空白、プリプロセスディレクティブ
     909                                        when /\A\s+/
     910                                                ;
     911                                        # 識別子
     912                                        when /\A[a-zA-Z_]\w*/
     913                                                word = $&
     914                                                @q << [RESERVED[word] || :IDENTIFIER, Token.new(word.intern, file, lineno, col)]
     915                                        # 16 進数定数
     916                                        when /\A0x[0-9A-Fa-f]+#{integer_qualifier}/
     917                                                @q << [:HEX_CONSTANT, Token.new($&, file, lineno, col)]
     918                                        # 8 進数定数
     919                                        when /\A0[0-7]+#{integer_qualifier}/
     920                                                @q << [:OCTAL_CONSTANT, Token.new($&, file, lineno, col)]
     921                                        # 浮動小数定数
     922                                        when /\A[0-9]+\.([0-9]*)?([Ee][+-]?[0-9]+)?/
     923                                                @q << [:FLOATING_CONSTANT, Token.new($&, file, lineno, col)]
     924                                        # 整数定数
     925                                        when /\A\d+#{integer_qualifier}/
     926                                        # when /\A\d+/
     927                                                @q << [:INTEGER_CONSTANT, Token.new($&.to_i, file, lineno, col)]
     928                                        # 文字
     929                                        when /\A'(?:[^'\\]|\\.)'/
     930                                                @q << [:CHARACTER_LITERAL, Token.new($&, file, lineno, col)]
     931                                        # 文字列
     932#                                       "#include  #include #include \"../systask/logtask.cfg\"       最後の " 忘れ)で無限ループ
     933#                                       when /\A"(?:[^"\\]+|\\.)*"/
     934                                        when /\A"(?:[^"\\]|\\.)*"/   # これはうまく行くようだ
     935                                                @q << [:STRING_LITERAL, Token.new($&, file, lineno, col)]
     936                                        # 行コメント
     937                                        when /\A\/\/.*$/
     938                                                # 読み飛ばすだけ
     939                                        # コメント開始
     940                                        when /\A\/\*/
     941                                                comment = true
     942                                        when /\A>>=/, /\A<<=/, /\A>>/,  /\A<</
     943                                                @q << [$&, Token.new($&, file, lineno, col)]
     944                                        when /\A\+=/, /\A\-=/, /\A\*=/, /\A\/=/, /\A%=/, /\A&=/, /\A\|=/, /\A\^=/
     945                                                @q << [$&, Token.new($&, file, lineno, col)]
     946                                        when /\A::/, /\A==/, /\A!=/, /\A>=/, /\A<=/, /\A\->/, /\A\+\+/, /\A\-\-/
     947                                                @q << [$&, Token.new($&, file, lineno, col)]
     948                                        when /\A\|\|/, /\A\&\&/
     949                                                @q << [$&, Token.new($&, file, lineno, col)]
     950                                        when /\A./
     951                                                @q << [$&, Token.new($&, file, lineno, col)]
     952                                        else
     953                                                raise
     954                                        end
     955                                end
     956
     957                                line = $'
     958                                col += $&.length
     959                        end
     960
     961                        lineno += 1
     962                }
     963
     964                rescue => evar
     965                        Generator.error( "B1002 while open or reading \'$1\'" , file )
     966                        print_exception( evar )
     967                end
     968        }
     969
     970        # 終了の印
     971        @q << nil
     972
     973        @yydebug = true
     974        do_parse
     975
     976        ensure
     977                @@generator_nest -= 1
     978                TECS_LANG::reset_kcode
     979        end
     980
     981        end
     982
     983
     984        def next_token
     985                token = @q.shift
     986
     987                if token then
     988                        @@current_locale[@@generator_nest] = token[1].locale
     989
     990                        case token[1].val
     991                        when ";", ":", ",", "(", ")", "{", "}"
     992                        set_no_type_name false
     993                        when ".", "->"
     994                        set_no_type_name true
     995                        end
     996
     997                        # TYPE_NAME トークンへ置き換え
     998                        if @b_no_type_name == false
     999                                if token[0] == :IDENTIFIER && Namespace.is_typename?( token[1].val ) then
     1000                                        token[0] = :TYPE_NAME
     1001                                        locale = @@current_locale[@@generator_nest]
    9381002#print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}: type_name'\n" )
    939         end
    940       end
    941 
    942       if $debug then     # 070107 token 無効時ここを通さないようした (through 対応 -d の時に例外発生)
    943         locale = @@current_locale[@@generator_nest]
    944         if token then
    945           print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}'\n" )
    946         else
    947           print( "#{locale[0]}: line #{locale[1]} : EOF\n" )
    948         end
    949       end
    950     end
    951 
    952     token
    953   end
    954 
    955   def on_error(t, v, vstack)
    956     if v == "$" then
    957      Generator.error( "B1003 Unexpected EOF"  )
    958     else
    959      Generator.error( "B1004 syntax error near \'$1\'" , v.val )
    960     end
    961 
    962   end
    963 
    964   def self.current_locale
    965     @@current_locale[ @@generator_nest ]
    966   end
    967 
    968   @@n_error = 0
    969   @@n_warning = 0
    970   @@n_info = 0
    971 
    972   # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でエラー発生は不適切)
    973   def self.error( msg )
    974     @@n_error += 1
    975     locale = @@current_locale[ @@generator_nest ]
    976 
    977     if locale then
    978       Console.puts "error: #{locale[0]}: line #{locale[1]} #{msg}"
    979     else
    980       Console.puts "error: #{msg}"
    981     end
    982   end
    983 
    984   # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でウォーニング発生は不適切)
    985   def self.warning( msg )
    986     @@n_warning += 1
    987     locale = @@current_locale[ @@generator_nest ]
    988     Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}"
    989   end
    990 
    991   # このメソッドは構文解析、意味解析からのみ呼出し可
    992   def self.info( msg )
    993     @@n_info += 1
    994     locale = @@current_locale[ @@generator_nest ]
    995     Console.puts "info: #{locale[0]}: line #{locale[1]} #{msg}"
    996   end
    997 
    998   def self.get_n_error
    999     @@n_error
    1000   end
    1001 
    1002   def self.get_n_warning
    1003     @@n_warning
    1004   end
    1005 
    1006   def self.get_nest
    1007     @@generator_nest
    1008   end
    1009 
    1010   def set_no_type_name b_no_type_name
    1011     locale = @@current_locale[ @@generator_nest ]
     1003                                end
     1004                        end
     1005
     1006                        if $debug then     # 070107 token 無効時ここを通さないようした (through 対応 -d の時に例外発生)
     1007                                locale = @@current_locale[@@generator_nest]
     1008                                if token then
     1009                                        print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}'\n" )
     1010                                else
     1011                                        print( "#{locale[0]}: line #{locale[1]} : EOF\n" )
     1012                                end
     1013                        end
     1014                end
     1015
     1016                token
     1017        end
     1018
     1019        def on_error(t, v, vstack)
     1020                if v == "$" then
     1021                        Generator.error( "B1003 Unexpected EOF"  )
     1022                else
     1023                        Generator.error( "B1004 syntax error near \'$1\'" , v.val )
     1024                end
     1025
     1026        end
     1027
     1028        def self.current_locale
     1029                @@current_locale[ @@generator_nest ]
     1030        end
     1031
     1032        @@n_error = 0
     1033        @@n_warning = 0
     1034        @@n_info = 0
     1035
     1036        # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でエラー発生は不適切)
     1037        def self.error( msg )
     1038                @@n_error += 1
     1039                locale = @@current_locale[ @@generator_nest ]
     1040
     1041                if locale then
     1042                        Console.puts "error: #{locale[0]}: line #{locale[1]} #{msg}"
     1043                else
     1044                        Console.puts "error: #{msg}"
     1045                end
     1046        end
     1047
     1048        # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でウォーニング発生は不適切)
     1049        def self.warning( msg )
     1050                @@n_warning += 1
     1051                locale = @@current_locale[ @@generator_nest ]
     1052                Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}"
     1053        end
     1054
     1055        # このメソッドは構文解析、意味解析からのみ呼出し可
     1056        def self.info( msg )
     1057                @@n_info += 1
     1058                locale = @@current_locale[ @@generator_nest ]
     1059                Console.puts "info: #{locale[0]}: line #{locale[1]} #{msg}"
     1060        end
     1061
     1062        def self.get_n_error
     1063                @@n_error
     1064        end
     1065
     1066        def self.get_n_warning
     1067                @@n_warning
     1068        end
     1069
     1070        def self.get_nest
     1071                @@generator_nest
     1072        end
     1073
     1074        def set_no_type_name b_no_type_name
     1075                locale = @@current_locale[ @@generator_nest ]
    10121076#print "b_no_type_name=#{b_no_type_name} #{locale[0]}: line #{locale[1]}\n"
    1013     @b_no_type_name = b_no_type_name
    1014   end
     1077                @b_no_type_name = b_no_type_name
     1078        end
    10151079
    10161080---- footer
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/bnf.tab.rb

    r337 r374  
    284284                  string += line
    285285                  # この位置では error メソッドは使えない (token 読出し前)
    286                   puts "error: #{file} line #{lineno}: string literal has newline without escape"
     286                  puts "#{file}:#{lineno}:#{col}: error: string literal has newline without escape"
    287287                  @@n_error += 1
    288288                end
     
    325325                  b_in_string = true
    326326                  # この位置では error メソッドは使えない (token 読出し前) # mikan cdl_error ではない
    327                   puts "error: #{file} line #{lineno}: string literal has newline without escape"
     327                  puts "#{file}:#{lineno}:#{col}: error: string literal has newline without escape"
    328328                  @@n_error += 1
    329329                # 山括弧で囲まれた文字列
    330                 when /\A<[0-9A-Za-z_\. \/]+>/   # AB: angle bracke
     330                # when /\A<[0-9A-Za-z_\. \/]+>/   # AB: angle bracke
     331                when /\A<(?:[^>\\]|\\.)*>/   # これはうまく行くようだ
    331332                  @q << [:AB_STRING_LITERAL, Token.new($&, file, lineno, col)]
    332333                # 行コメント
     
    458459      end
    459460      if locale then
    460         Console.puts "error: #{locale[0]}: line #{locale[1]} #{msg}"
     461        Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: error: #{msg}"
    461462      else
    462463        Console.puts "error: #{msg}"
     
    491492      end
    492493      if locale then
    493         Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}"
     494        Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: warning: #{msg}"
    494495      else
    495496        Console.puts "warning: #{msg}"
     
    524525      end
    525526      if locale then
    526         Console.puts "info: #{locale[0]}: line #{locale[1]} #{msg}"
     527        Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: info: #{msg}"
    527528      else
    528529        Console.puts "info: #{msg}"
     
    589590
    590591clist = [
    591 '66,575,328,666,538,872,78,330,562,328,78,78,78,163,199,200,201,202,203',
    592 '204,205,207,846,208,678,700,897,135,647,212,213,214,215,216,217,218',
    593 '679,249,761,711,565,547,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24',
     592'66,575,328,559,538,815,78,330,869,328,78,78,78,409,199,200,201,202,203',
     593'204,205,207,846,208,678,135,897,135,647,212,213,214,215,216,217,218',
     594'249,679,177,872,870,408,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24',
    594595'25,26,27,28,29,30,31,32,33,34,35,38,465,189,693,333,334,42,43,44,45',
    595 '46,47,48,49,896,180,644,256,559,177,815,163,135,189,135,135,135,135',
    596 '189,66,189,189,70,68,69,135,71,72,328,73,78,74,304,305,324,860,901,189',
    597 '255,162,325,136,327,189,75,75,75,76,77,77,77,135,88,189,189,189,189',
    598 '79,87,101,80,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28',
    599 '29,30,31,32,33,34,35,38,78,426,569,668,899,42,43,44,45,46,47,48,49,189',
    600 '178,189,136,66,136,136,136,136,256,135,446,89,100,78,78,136,328,70,68',
    601 '69,667,71,72,135,73,571,74,304,305,324,135,135,135,478,868,325,479,327',
    602 '867,399,75,136,76,89,77,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24',
    603 '25,26,27,28,29,30,31,32,33,34,35,38,450,48,49,400,839,42,43,44,45,46',
    604 '47,48,49,135,135,328,838,66,304,305,306,607,307,308,310,311,406,208',
    605 '78,136,136,70,68,69,401,71,72,797,73,150,74,78,149,136,654,304,305,324',
    606 '78,796,136,136,136,325,75,327,76,407,77,5,6,7,10,13,14,15,16,17,18,19',
    607 '20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,835,163,403,661,402',
    608 '42,43,44,45,46,47,48,49,163,648,826,403,88,697,136,136,432,78,87,681',
    609 '816,574,89,208,520,720,70,68,69,660,71,72,532,73,196,74,510,636,827',
    610 '199,200,201,202,203,204,205,207,208,208,75,682,76,135,77,212,213,214',
    611 '215,216,217,218,304,305,306,889,307,308,310,311,199,200,201,202,203',
    612 '204,205,207,817,208,635,747,518,135,637,212,213,214,215,216,217,218',
    613 '529,888,415,199,200,201,202,203,204,205,207,341,208,342,528,343,135',
    614 '234,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,414',
    615 '208,270,878,235,135,719,212,213,214,215,216,217,218,525,277,589,504',
    616 '691,314,180,136,582,590,721,581,199,200,201,202,203,204,205,207,879',
    617 '208,720,587,163,135,776,212,213,214,215,216,217,218,503,690,313,136',
    618 '199,200,201,202,203,204,205,207,264,208,523,698,282,135,770,212,213',
    619 '214,215,216,217,218,347,582,136,275,581,348,349,898,180,850,199,200',
    620 '201,202,203,204,205,207,163,208,699,283,91,135,136,212,213,214,215,216',
    621 '217,218,199,200,201,202,203,204,205,207,851,208,722,833,691,135,162',
    622 '212,213,214,215,216,217,218,630,163,88,887,136,902,478,886,87,479,347',
    623 '859,89,163,409,348,349,88,631,699,832,794,903,87,904,234,592,89,629',
    624 '170,136,199,200,201,202,203,204,205,207,858,208,564,408,90,135,235,212',
    625 '213,214,215,216,217,218,522,199,200,201,202,203,204,205,207,136,208',
    626 '521,150,906,135,149,212,213,214,215,216,217,218,199,200,201,202,203',
    627 '204,205,207,136,208,394,395,396,135,360,212,213,214,215,216,217,218',
    628 '199,200,201,202,203,204,205,207,361,208,394,395,396,135,362,212,213',
    629 '214,215,216,217,218,145,146,363,199,200,201,202,203,204,205,207,437',
    630 '208,287,288,454,135,136,212,213,214,215,216,217,218,234,354,355,356',
    631 '357,591,436,438,439,440,441,456,457,458,455,136,347,350,351,515,235',
    632 '348,349,199,200,201,202,203,204,205,207,907,208,352,353,514,135,136',
    633 '212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,513,208',
    634 '358,359,512,135,136,212,213,214,215,216,217,218,364,365,511,199,200',
    635 '201,202,203,204,205,207,208,208,404,336,482,135,136,212,213,214,215',
    636 '216,217,218,199,200,201,202,203,204,205,207,481,208,517,518,474,135',
    637 '473,212,213,214,215,216,217,218,472,199,200,201,202,203,204,205,207',
    638 '470,208,350,351,463,135,136,212,213,214,215,216,217,218,350,351,234',
    639 '354,355,356,357,607,454,737,738,740,741,437,136,88,352,353,196,739,785',
    640 '87,235,608,234,89,610,743,742,456,457,458,455,436,438,439,440,441,611',
    641 '136,354,355,356,357,235,352,353,199,200,201,202,203,204,205,207,336',
    642 '208,352,353,612,135,136,212,213,214,215,216,217,218,614,199,200,201',
    643 '202,203,204,205,207,472,208,352,353,615,135,136,212,213,214,215,216',
    644 '217,218,199,200,201,202,203,204,205,207,616,208,358,359,617,135,618',
    645 '212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,208,208',
    646 '594,336,908,135,621,212,213,214,215,216,217,218,620,288,163,199,200',
    647 '201,202,203,204,205,207,462,208,787,788,459,135,136,212,213,214,215',
    648 '216,217,218,625,199,200,201,202,203,204,205,207,448,208,789,790,445',
     596'46,47,48,49,896,88,644,406,666,761,711,87,135,871,135,135,135,135,189',
     597'66,189,189,70,68,69,135,71,72,328,73,78,74,304,305,324,860,901,189,407',
     598'136,325,136,327,189,75,75,75,76,77,77,77,135,874,178,189,189,189,79',
     599'875,101,80,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28',
     600'29,30,31,32,33,34,35,38,78,364,365,256,899,42,43,44,45,46,47,48,49,189',
     601'189,189,136,66,136,136,136,136,878,135,135,89,100,78,78,136,328,70,68',
     602'69,399,71,72,135,73,877,74,304,305,324,135,446,135,478,868,325,479,327',
     603'867,879,75,136,76,89,77,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24',
     604'25,26,27,28,29,30,31,32,33,34,35,38,450,48,49,314,838,42,43,44,45,46',
     605'47,48,49,135,135,839,135,66,304,305,306,135,307,308,310,311,691,838',
     606'78,136,136,70,68,69,313,71,72,275,73,880,74,78,180,136,816,304,305,324',
     607'78,881,136,136,136,325,75,327,76,690,77,5,6,7,10,13,14,15,16,17,18,19',
     608'20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,835,426,403,282,697',
     609'42,43,44,45,46,47,48,49,163,817,163,620,288,277,136,136,432,136,180',
     610'504,78,150,136,654,149,720,70,68,69,283,71,72,403,73,402,74,520,636',
     611'162,199,200,201,202,203,204,205,207,328,208,75,503,76,135,77,212,213',
     612'214,215,216,217,218,304,305,306,859,307,308,310,311,199,200,201,202',
     613'203,204,205,207,889,208,635,648,883,135,637,212,213,214,215,216,217',
     614'218,884,858,681,199,200,201,202,203,204,205,207,341,208,342,888,343',
     615'135,234,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207',
     616'682,208,885,668,235,135,661,212,213,214,215,216,217,218,88,789,790,691',
     617'256,400,87,136,150,890,89,149,199,200,201,202,203,204,205,207,667,208',
     618'891,660,163,135,776,212,213,214,215,216,217,218,794,255,401,136,199',
     619'200,201,202,203,204,205,207,892,208,719,415,850,135,162,212,213,214',
     620'215,216,217,218,887,898,136,902,886,582,721,903,581,833,199,200,201',
     621'202,203,204,205,207,720,208,414,851,904,135,136,212,213,214,215,216',
     622'217,218,199,200,201,202,203,204,205,207,832,208,722,698,826,135,906',
     623'212,213,214,215,216,217,218,163,163,88,478,136,907,479,582,87,908,581',
     624'607,89,163,3,163,88,910,827,699,699,81,87,352,353,234,89,797,170,770',
     625'136,199,200,201,202,203,204,205,207,796,208,547,587,564,135,235,212',
     626'213,214,215,216,217,218,90,199,200,201,202,203,204,205,207,136,208,394',
     627'395,396,135,91,212,213,214,215,216,217,218,199,200,201,202,203,204,205',
     628'207,136,208,394,395,396,135,92,212,213,214,215,216,217,218,199,200,201',
     629'202,203,204,205,207,163,208,350,351,96,135,124,212,213,214,215,216,217',
     630'218,594,336,125,199,200,201,202,203,204,205,207,126,208,130,510,132',
     631'135,136,212,213,214,215,216,217,218,134,199,200,201,202,203,204,205',
     632'207,140,208,352,353,142,135,136,212,213,214,215,216,217,218,199,200',
     633'201,202,203,204,205,207,143,208,404,336,144,135,136,212,213,214,215',
     634'216,217,218,199,200,201,202,203,204,205,207,147,208,358,359,155,135',
     635'136,212,213,214,215,216,217,218,350,351,156,199,200,201,202,203,204',
     636'205,207,159,208,350,351,160,135,136,212,213,214,215,216,217,218,164',
     637'199,200,201,202,203,204,205,207,165,208,358,359,166,135,136,212,213',
     638'214,215,216,217,218,199,200,201,202,203,204,205,207,167,208,630,437',
     639'168,135,136,212,213,214,215,216,217,218,352,353,234,747,518,171,631',
     640'287,288,436,438,439,440,441,136,347,629,172,347,173,348,349,235,348',
     641'349,199,200,201,202,203,204,205,207,174,208,352,353,175,135,136,212',
     642'213,214,215,216,217,218,176,199,200,201,202,203,204,205,207,180,208',
     643'184,772,185,135,136,212,213,214,215,216,217,218,199,200,201,202,203',
     644'204,205,207,454,208,145,146,186,135,136,212,213,214,215,216,217,218',
     645'347,187,234,517,518,348,349,456,457,458,455,199,200,201,202,203,204',
     646'205,207,454,208,188,235,189,135,191,212,213,214,215,216,217,218,354',
     647'355,356,357,787,788,136,456,457,458,455,354,355,356,357,199,200,201',
     648'202,203,204,205,207,437,208,382,383,384,135,136,212,213,214,215,216',
     649'217,218,377,378,379,380,381,385,436,438,439,440,441,304,305,306,136',
     650'307,308,310,311,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27',
     651'28,29,30,31,32,33,34,35,38,136,354,355,356,357,42,43,44,45,46,47,48',
     652'49,199,200,201,202,203,204,205,207,192,208,352,353,193,135,196,212,213',
     653'214,215,216,217,218,247,89,136,199,200,201,202,203,204,205,207,257,208',
     654'159,264,208,135,270,212,213,214,215,216,217,218,199,200,201,202,203',
     655'204,205,207,180,208,272,279,280,135,281,212,213,214,215,216,217,218',
     656'234,284,285,286,289,290,199,200,201,202,203,204,205,207,312,208,335',
     657'189,336,135,235,212,213,214,215,216,217,218,360,199,200,201,202,203',
     658'204,205,207,136,208,361,670,362,135,363,212,213,214,215,216,217,218',
     659'199,200,201,202,203,204,205,207,368,208,369,136,371,135,372,212,213',
     660'214,215,216,217,218,159,199,200,201,202,203,204,205,207,405,208,136',
     661'587,410,135,142,212,213,214,215,216,217,218,412,413,199,200,201,202',
     662'203,204,205,207,416,208,417,418,419,135,136,212,213,214,215,216,217',
     663'218,420,199,200,201,202,203,204,205,207,421,208,444,445,448,135,136',
     664'212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,459,208',
     665'462,772,463,135,136,212,213,214,215,216,217,218,470,88,234,88,382,383',
     666'384,87,472,87,473,89,474,89,481,136,377,378,379,380,381,385,235,482',
     667'208,199,200,201,202,203,204,205,207,511,208,512,513,514,135,136,212',
     668'213,214,215,216,217,218,515,199,200,201,202,203,204,205,207,521,208',
     669'522,523,264,135,136,212,213,214,215,216,217,218,199,200,201,202,203',
     670'204,205,207,525,208,270,528,529,135,136,212,213,214,215,216,217,218',
     671'199,200,201,202,203,204,205,207,208,208,532,208,208,135,180,212,213',
     672'214,215,216,217,218,536,537,540,199,200,201,202,203,204,205,207,541',
     673'208,542,544,545,135,136,212,213,214,215,216,217,218,737,738,740,741',
     674'548,189,270,558,562,196,739,737,738,740,741,136,565,189,743,742,196',
     675'739,234,592,569,88,88,571,88,743,742,87,87,88,87,89,89,136,89,87,328',
     676'574,235,89,196,199,200,201,202,203,204,205,207,589,208,590,700,360,135',
     677'136,212,213,214,215,216,217,218,361,362,472,199,200,201,202,203,204',
     678'205,207,363,208,472,591,607,135,136,212,213,214,215,216,217,218,199',
     679'200,201,202,203,204,205,207,608,208,611,336,612,135,614,212,213,214',
     680'215,216,217,218,199,200,201,202,203,204,205,207,615,208,616,617,618',
     681'135,208,212,213,214,215,216,217,218,621,737,738,740,741,163,625,88,88',
     682'641,196,739,785,87,87,136,643,89,89,743,742,625,662,663,669,674,199',
     683'200,201,202,203,204,205,207,675,208,676,680,683,135,136,212,213,214',
     684'215,216,217,218,199,200,201,202,203,204,205,207,685,208,686,687,688',
     685'135,136,212,213,214,215,216,217,218,472,104,105,106,107,108,109,110',
     686'111,112,113,114,689,189,136,692,208,695,704,5,6,7,10,13,14,15,16,17',
     687'18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,163,706,707',
     688'708,163,42,43,44,45,46,47,48,49,710,712,136,117,118,119,120,121,122',
     689'123,199,200,201,202,203,204,205,207,713,208,714,715,718,135,136,212',
     690'213,214,215,216,217,218,199,200,201,202,203,204,205,207,723,208,726',
     691'571,75,135,729,212,213,214,215,216,217,218,199,200,201,202,203,204,205',
     692'207,730,208,196,744,745,135,748,212,213,214,215,216,217,218,199,200',
     693'201,202,203,204,205,207,749,208,752,753,754,135,756,212,213,214,215',
     694'216,217,218,625,759,760,764,199,200,201,202,203,204,205,207,767,208',
     695'771,779,780,135,136,212,213,214,215,216,217,218,199,200,201,202,203',
     696'204,205,207,782,208,783,791,793,135,136,212,213,214,215,216,217,218',
     697'199,200,201,202,203,204,205,207,189,208,795,798,799,135,136,212,213',
     698'214,215,216,217,218,199,200,201,202,203,204,205,207,800,208,803,804',
     699'805,135,136,212,213,214,215,216,217,218,806,654,718,180,199,200,201',
     700'202,203,204,205,207,811,208,812,813,814,135,136,212,213,214,215,216',
     701'217,218,199,200,201,202,203,204,205,207,726,208,823,828,831,135,136',
     702'212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,836,208',
     703'840,841,-386,135,136,212,213,214,215,216,217,218,199,200,201,202,203',
     704'204,205,207,842,208,843,237,844,135,136,212,213,214,215,216,217,218',
     705'848,803,208,854,199,200,201,202,203,204,205,207,857,208,862,863,865',
    649706'135,136,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207',
    650 '444,208,421,772,641,135,136,212,213,214,215,216,217,218,88,88,234,382',
    651 '383,384,87,87,420,643,89,89,419,418,136,377,378,379,380,381,385,417',
    652 '235,416,625,199,200,201,202,203,204,205,207,413,208,412,662,663,135',
    653 '136,212,213,214,215,216,217,218,142,199,200,201,202,203,204,205,207',
    654 '410,208,405,159,669,135,136,212,213,214,215,216,217,218,199,200,201',
    655 '202,203,204,205,207,372,208,371,369,674,135,136,212,213,214,215,216',
    656 '217,218,199,200,201,202,203,204,205,207,368,208,675,237,676,135,363',
    657 '212,213,214,215,216,217,218,304,305,306,234,307,308,310,311,362,199',
    658 '200,201,202,203,204,205,207,136,208,361,680,360,135,235,212,213,214',
    659 '215,216,217,218,683,199,200,201,202,203,204,205,207,136,208,336,685',
    660 '686,135,687,212,213,214,215,216,217,218,199,200,201,202,203,204,205',
    661 '207,136,208,688,689,189,135,692,212,213,214,215,216,217,218,199,200',
    662 '201,202,203,204,205,207,136,208,335,208,695,135,312,212,213,214,215',
    663 '216,217,218,290,289,286,199,200,201,202,203,204,205,207,285,208,704',
    664 '163,706,135,136,212,213,214,215,216,217,218,737,738,740,741,707,708',
    665 '88,88,163,196,739,710,87,87,284,136,89,89,743,742,712,713,714,199,200',
    666 '201,202,203,204,205,207,715,208,718,281,280,135,136,212,213,214,215',
    667 '216,217,218,199,200,201,202,203,204,205,207,723,208,726,571,75,135,136',
    668 '212,213,214,215,216,217,218,729,730,472,20,21,22,23,24,25,26,27,28,29',
    669 '30,31,32,33,136,196,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25',
    670 '26,27,28,29,30,31,32,33,34,35,38,279,744,745,272,3,42,43,44,45,46,47',
    671 '48,49,748,749,136,117,118,119,120,121,122,123,199,200,201,202,203,204',
    672 '205,207,750,208,610,752,753,135,136,212,213,214,215,216,217,218,199',
    673 '200,201,202,203,204,205,207,754,208,180,756,625,135,759,212,213,214',
    674 '215,216,217,218,199,200,201,202,203,204,205,207,760,208,270,208,264',
    675 '135,764,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207',
    676 '159,208,257,767,89,135,247,212,213,214,215,216,217,218,771,196,193,192',
    677 '199,200,201,202,203,204,205,207,779,208,780,191,782,135,136,212,213',
    678 '214,215,216,217,218,199,200,201,202,203,204,205,207,783,208,189,81,910',
    679 '135,136,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207',
    680 '791,208,188,793,187,135,136,212,213,214,215,216,217,218,199,200,201',
    681 '202,203,204,205,207,795,208,186,670,798,135,136,212,213,214,215,216',
    682 '217,218,799,800,803,804,199,200,201,202,203,204,205,207,805,208,806',
    683 '654,718,135,136,212,213,214,215,216,217,218,737,738,740,741,180,88,88',
    684 '88,811,196,739,87,87,87,136,89,89,89,743,742,812,813,199,200,201,202',
    685 '203,204,205,207,814,208,185,184,726,135,136,212,213,214,215,216,217',
    686 '218,199,200,201,202,203,204,205,207,823,208,180,176,175,135,136,212',
    687 '213,214,215,216,217,218,382,383,384,472,117,118,119,120,121,122,123',
    688 '828,377,378,379,380,381,385,136,5,6,7,10,13,14,15,16,17,18,19,20,21',
    689 '22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,174,173,831,172,171,42',
    690 '43,44,45,46,47,48,49,168,836,136,167,166,840,841,-386,842,843,199,200',
    691 '201,202,203,204,205,207,844,208,165,164,160,135,136,212,213,214,215',
    692 '216,217,218,199,200,201,202,203,204,205,345,848,208,803,159,156,135',
    693 '208,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,854',
    694 '208,155,147,857,135,144,212,213,214,215,216,217,218,199,200,201,202',
    695 '203,204,205,207,143,208,862,863,142,135,865,212,213,214,215,216,217',
    696 '218,140,869,870,871,199,200,201,202,203,204,205,207,134,208,132,874',
    697 '875,135,136,212,213,214,215,216,217,218,199,200,201,202,203,204,205',
    698 '207,130,208,877,126,838,135,136,212,213,214,215,216,217,218,199,200',
    699 '201,202,203,204,205,207,880,208,881,587,328,135,136,212,213,214,215',
    700 '216,217,218,199,200,201,202,203,204,205,207,883,208,884,885,125,135',
    701 '136,212,213,214,215,216,217,218,124,890,891,234,104,105,106,107,108',
    702 '109,110,111,112,113,114,88,892,96,136,92,544,87,545,235,542,89,199,200',
    703 '201,202,203,204,205,207,548,208,189,270,541,135,136,212,213,214,215',
    704 '216,217,218,199,200,201,202,203,204,205,207,540,208,558,537,536,135',
    705 '136,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,,208',
    706 ',,,135,136,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207',
    707 ',208,,,,135,,212,213,214,215,216,217,218,,,,,199,200,201,202,203,204',
    708 '205,207,,208,,772,,135,136,212,213,214,215,216,217,218,199,200,201,202',
    709 '203,204,205,207,,208,,,,135,136,212,213,214,215,216,217,218,199,200',
    710 '201,202,203,204,205,207,,208,,,,135,136,212,213,214,215,216,217,218',
    711 '199,200,201,202,203,204,205,207,,208,,,,135,136,212,213,214,215,216',
    712 '217,218,,,,,199,200,201,202,203,204,205,207,,208,,,,135,136,212,213',
    713 '214,215,216,217,218,199,200,201,202,203,204,205,207,,208,,,,135,136',
    714 '212,213,214,215,216,217,218,737,738,740,741,,88,,,,196,739,87,,,136',
    715 '89,,,743,742,,,,,,,,,,,,,,,,,136,104,105,106,107,108,109,110,111,112',
    716 '113,114,,,,478,585,,584,,,,,,,89,136,,,,,,,472,,,,,,117,118,119,120',
    717 '121,122,123,,,136,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26',
    718 '27,28,29,30,31,32,33,34,35,38,241,,78,,,42,43,44,45,46,47,48,49,,,,',
    719 ',,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27',
    720 '28,29,30,31,32,33,34,35,38,672,,78,,,42,43,44,45,46,47,48,49,,,,,,,',
    721 ',,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28',
     707',208,,,,135,136,212,213,214,215,216,217,218,199,200,201,202,203,204',
     708'205,207,,208,,,,135,136,212,213,214,215,216,217,218,199,200,201,202',
     709'203,204,205,207,,208,,,,135,136,212,213,214,215,216,217,218,88,,,,,',
     710'87,,,88,89,737,738,740,741,87,,,136,89,196,739,,,,234,,,,743,742,117',
     711'118,119,120,121,122,123,,,136,,,,,235,,,199,200,201,202,203,204,205',
     712'207,,208,,,,135,136,212,213,214,215,216,217,218,199,200,201,202,203',
     713'204,205,207,,208,472,,,135,136,212,213,214,215,216,217,218,199,200,201',
     714'202,203,204,205,345,,208,,,,135,,212,213,214,215,216,217,218,199,200',
     715'201,202,203,204,205,207,,208,,,,135,,212,213,214,215,216,217,218,,,',
     716'104,105,106,107,108,109,110,111,112,113,114,,,,,136,,,,,,,104,105,106',
     717'107,108,109,110,111,112,113,114,,,,,136,117,118,119,120,121,122,123',
     718',,,478,585,,584,,,,,,,89,136,117,118,119,120,121,122,123,20,21,22,23',
     719'24,25,26,27,28,29,30,31,32,33,136,5,6,7,10,13,14,15,16,17,18,19,20,21',
     720'22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,672,,78,,,42,43,44,45,46',
     721'47,48,49,,,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22',
     722'23,24,25,26,27,28,29,30,31,32,33,34,35,38,241,,78,,,42,43,44,45,46,47',
     723'48,49,,,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23',
     724'24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49',
     725',,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26',
     726'27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,506,,,',
     727',,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27',
     728'28,29,30,31,32,33,34,35,38,78,428,,,,42,43,44,45,46,47,48,49,,,,,,,',
     729',,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28',
    722730'29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,',
    723731',,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30',
    724 '31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,506,,,,,,,,,,,,,,,',
    725 ',,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31',
    726 '32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6',
    727 '7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33',
    728 '34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13',
    729 '14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38',
    730 '78,428,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15',
    731 '16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,',
    732 ',,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17',
    733 '18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,387,,,,42',
     732'31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5',
     733'6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33',
     734'34,35,38,78,632,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10',
     735'13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35',
     736'38,78,638,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14',
     737'15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,128',
     738'658,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16',
     739'17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42',
    734740'43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19',
    735 '20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45',
    736 '46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22',
    737 '23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48',
    738 '49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25',
    739 '26,27,28,29,30,31,32,33,34,35,38,128,516,,,,42,43,44,45,46,47,48,49',
     741'20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,516,,,,42,43,44',
     742'45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21',
     743'22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47',
     744'48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24',
     745'25,26,27,28,29,30,31,32,33,34,35,38,78,387,,,,42,43,44,45,46,47,48,49',
    740746',,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26',
    741747'27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,',
    742748',,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28',
    743 '29,30,31,32,33,34,35,38,78,632,,,,42,43,44,45,46,47,48,49,,,,,,,,,,',
    744 ',,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29',
    745 '30,31,32,33,34,35,38,78,638,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,',
    746 ',,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30',
    747 '31,32,33,34,35,38,,658,,,,42,43,44,45,46,47,48,49,104,105,106,107,108',
    748 '109,110,111,112,113,114,,,,,,,,,,,,,,,,,,,,,,,,,,,,117,118,119,120,121',
    749 '122,123,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29',
    750 '30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15',
    751 '16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,',
    752 '42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24',
    753 '25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6',
    754 '7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33',
    755 '34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18,19',
    756 '20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45',
    757 '46,47,48,49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28',
    758749'29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14',
    759750'15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,,',
    760751',,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23',
    761 '24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47' ]
    762         racc_action_table = arr = ::Array.new(3623, nil)
     752'24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49',
     753'5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32',
     754'33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18',
     755'19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44',
     756'45,46,47,48,49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27',
     757'28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13',
     758'14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38',
     759',,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18,19,20,21,22',
     760'23,24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48',
     761'49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31',
     762'32,33,34,35,38,,,,,,42,43,44,45,46,47' ]
     763        racc_action_table = arr = ::Array.new(3593, nil)
    763764        idx = 0
    764765        clist.each do |str|
     
    770771
    771772clist = [
    772 '2,469,843,576,422,856,192,194,450,192,329,2,613,434,630,630,630,630',
    773 '630,630,630,630,824,630,596,630,893,630,560,630,630,630,630,630,630',
    774 '630,597,154,703,642,454,434,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2',
    775 '2,2,2,2,2,2,2,2,329,422,613,194,194,2,2,2,2,2,2,2,2,893,414,560,157',
    776 '447,125,777,573,721,460,558,631,303,470,576,291,856,469,2,2,2,839,2',
    777 '2,563,2,291,2,192,192,192,843,895,824,157,573,192,630,192,596,329,2',
    778 '613,2,329,2,613,782,85,703,642,597,154,2,85,41,2,291,291,291,291,291',
     773'2,469,843,447,422,777,192,194,852,192,329,2,613,269,515,515,515,515',
     774'515,515,515,515,824,515,596,325,893,515,560,515,515,515,515,515,515',
     775'515,154,597,125,856,853,269,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2',
     776'2,2,2,2,2,2,2,2,329,422,613,194,194,2,2,2,2,2,2,2,2,893,85,560,267,576',
     777'703,642,85,721,855,631,558,528,511,447,161,777,469,2,2,2,92,2,2,563',
     778'2,161,2,192,192,192,843,895,824,267,325,192,515,192,596,329,2,613,2',
     779'329,2,613,75,860,125,856,154,597,2,861,41,2,161,161,161,161,161,161',
     780'161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161',
     781'161,161,161,161,161,187,230,230,258,895,161,161,161,161,161,161,161',
     782'161,576,703,642,721,185,631,558,528,511,866,691,303,89,41,315,185,92',
     783'315,161,161,161,258,161,161,333,161,863,161,563,563,563,286,308,782',
     784'340,851,563,340,563,851,866,161,75,161,340,161,185,185,185,185,185,185',
     785'185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185',
     786'185,185,185,185,185,315,89,89,190,869,185,185,185,185,185,185,185,185',
     787'839,470,812,692,291,187,187,187,512,187,187,187,187,609,812,291,691',
     788'303,185,185,185,190,185,185,171,185,872,185,778,171,333,778,315,315',
     789'315,294,873,286,308,782,315,185,315,185,609,185,291,291,291,291,291',
    779790'291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291',
    780 '291,291,291,291,291,291,187,291,461,577,895,291,291,291,291,291,291',
    781 '291,291,447,125,777,721,185,558,631,303,470,258,286,308,89,41,315,185',
    782 '839,315,291,291,291,577,291,291,92,291,462,291,563,563,563,512,75,325',
    783 '340,851,563,340,563,851,258,291,782,291,340,291,185,185,185,185,185',
    784 '185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185',
    785 '185,185,185,185,185,185,315,89,89,262,812,185,185,185,185,185,185,185',
    786 '185,511,333,463,812,161,187,187,187,756,187,187,187,187,267,413,161',
    787 '286,308,185,185,185,262,185,185,756,185,148,185,561,148,92,561,315,315',
    788 '315,294,756,512,75,325,315,185,315,185,267,185,161,161,161,161,161,161',
    789 '161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161',
    790 '161,161,161,161,161,808,392,264,568,264,161,161,161,161,161,161,161',
    791 '161,375,561,784,625,127,625,511,333,294,778,127,599,778,465,127,412',
    792 '392,808,161,161,161,568,161,161,411,161,472,161,375,553,784,720,720',
    793 '720,720,720,720,720,720,410,720,161,599,161,720,161,720,720,720,720',
    794 '720,720,720,294,294,294,880,294,294,294,294,257,257,257,257,257,257',
    795 '257,257,778,257,553,684,684,257,553,257,257,257,257,257,257,257,409',
    796 '880,278,474,474,474,474,474,474,474,474,210,474,210,408,210,474,720',
    797 '474,474,474,474,474,474,474,403,403,403,403,403,403,403,403,278,403',
    798 '407,866,720,403,653,403,403,403,403,403,403,403,402,172,480,366,609',
    799 '190,172,720,580,483,653,580,479,479,479,479,479,479,479,479,866,479',
    800 '653,479,716,479,720,479,479,479,479,479,479,479,366,609,190,257,889',
    801 '889,889,889,889,889,889,889,401,889,396,626,176,889,716,889,889,889',
    802 '889,889,889,889,488,477,474,171,477,488,488,894,171,834,504,504,504',
    803 '504,504,504,504,504,102,504,626,176,9,504,403,504,504,504,504,504,504',
    804 '504,862,862,862,862,862,862,862,862,834,862,657,801,751,862,102,862',
    805 '862,862,862,862,862,862,549,115,253,879,479,897,476,879,253,476,221',
    806 '841,253,452,269,221,221,88,549,657,801,751,898,88,901,504,504,88,549',
    807 '115,889,859,859,859,859,859,859,859,859,841,859,452,269,8,859,504,859',
    808 '859,859,859,859,859,859,395,513,513,513,513,513,513,513,513,504,513',
    809 '394,86,904,513,86,513,513,513,513,513,513,513,848,848,848,848,848,848',
    810 '848,848,862,848,254,254,254,848,498,848,848,848,848,848,848,848,359',
    811 '359,359,359,359,359,359,359,499,359,520,520,520,359,500,359,359,359',
    812 '359,359,359,359,82,82,501,358,358,358,358,358,358,358,358,547,358,181',
    813 '181,564,358,859,358,358,358,358,358,358,358,848,496,496,496,496,502',
    814 '547,547,547,547,547,564,564,564,564,513,487,222,222,384,848,487,487',
    815 '806,806,806,806,806,806,806,806,905,806,223,223,383,806,848,806,806',
    816 '806,806,806,806,806,357,357,357,357,357,357,357,357,382,357,225,225',
    817 '381,357,359,357,357,357,357,357,357,357,230,230,380,797,797,797,797',
    818 '797,797,797,797,368,797,265,265,343,797,358,797,797,797,797,797,797',
    819 '797,796,796,796,796,796,796,796,796,342,796,389,389,338,796,337,796',
    820 '796,796,796,796,796,796,335,356,356,356,356,356,356,356,356,334,356',
    821 '489,489,327,356,806,356,356,356,356,356,356,356,490,490,797,495,495',
    822 '495,495,525,318,739,739,739,739,297,357,696,491,491,739,739,739,696',
    823 '797,526,796,696,528,739,739,318,318,318,318,297,297,297,297,297,529',
    824 '797,224,224,224,224,796,492,492,355,355,355,355,355,355,355,355,530',
    825 '355,493,493,531,355,796,355,355,355,355,355,355,355,533,354,354,354',
    826 '354,354,354,354,354,739,354,494,494,534,354,356,354,354,354,354,354',
    827 '354,354,353,353,353,353,353,353,353,353,535,353,497,497,536,353,537',
    828 '353,353,353,353,353,353,353,352,352,352,352,352,352,352,352,538,352',
    829 '505,505,906,352,543,352,352,352,352,352,352,352,539,539,544,748,748',
    830 '748,748,748,748,748,748,326,748,742,742,324,748,355,748,748,748,748',
    831 '748,748,748,548,729,729,729,729,729,729,729,729,309,729,743,743,307',
    832 '729,354,729,729,729,729,729,729,729,719,719,719,719,719,719,719,719',
    833 '306,719,285,719,557,719,353,719,719,719,719,719,719,719,430,602,748',
    834 '246,246,246,430,602,284,559,430,602,283,282,352,246,246,246,246,246',
    835 '246,281,748,280,565,351,351,351,351,351,351,351,351,276,351,274,570',
    836 '572,351,748,351,351,351,351,351,351,351,272,147,147,147,147,147,147',
    837 '147,147,271,147,266,256,578,147,729,147,147,147,147,147,147,147,350',
    838 '350,350,350,350,350,350,350,242,350,240,236,583,350,719,350,350,350',
    839 '350,350,350,350,149,149,149,149,149,149,149,149,235,149,586,149,588',
    840 '149,229,149,149,149,149,149,149,149,546,546,546,147,546,546,546,546',
    841 '228,349,349,349,349,349,349,349,349,351,349,227,598,226,349,147,349',
    842 '349,349,349,349,349,349,600,714,714,714,714,714,714,714,714,147,714',
    843 '206,604,605,714,606,714,714,714,714,714,714,714,348,348,348,348,348',
    844 '348,348,348,350,348,607,608,198,348,611,348,348,348,348,348,348,348',
    845 '710,710,710,710,710,710,710,710,149,710,195,616,619,710,189,710,710',
    846 '710,710,710,710,710,184,183,179,347,347,347,347,347,347,347,347,178',
    847 '347,632,634,636,347,349,347,347,347,347,347,347,347,827,827,827,827',
    848 '637,638,373,288,640,827,827,641,373,288,177,714,373,288,827,827,643',
    849 '644,646,706,706,706,706,706,706,706,706,648,706,651,175,174,706,348',
    850 '706,706,706,706,706,706,706,345,345,345,345,345,345,345,345,658,345',
    851 '662,663,664,345,710,345,345,345,345,345,345,345,665,666,827,36,36,36',
    852 '36,36,36,36,36,36,36,36,36,36,36,347,668,345,345,345,345,345,345,345',
    853 '345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345',
    854 '345,345,345,345,173,671,673,169,1,345,345,345,345,345,345,345,345,688',
    855 '689,706,260,260,260,260,260,260,260,515,515,515,515,515,515,515,515',
    856 '691,515,692,693,694,515,345,515,515,515,515,515,515,515,166,166,166',
    857 '166,166,166,166,166,695,166,168,697,699,166,700,166,166,166,166,166',
    858 '166,166,341,341,341,341,341,341,341,341,701,341,167,165,164,341,707',
    859 '341,341,341,341,341,341,341,682,682,682,682,682,682,682,682,160,682',
    860 '159,711,152,682,151,682,682,682,682,682,682,682,718,144,141,139,521',
    861 '521,521,521,521,521,521,521,725,521,727,138,730,521,515,521,521,521',
    862 '521,521,521,521,522,522,522,522,522,522,522,522,731,522,137,3,909,522',
    863 '166,522,522,522,522,522,522,522,523,523,523,523,523,523,523,523,746',
    864 '523,136,749,133,523,341,523,523,523,523,523,523,523,581,581,581,581',
    865 '581,581,581,581,755,581,131,581,760,581,682,581,581,581,581,581,581',
    866 '581,761,763,764,766,908,908,908,908,908,908,908,908,767,908,768,769',
    867 '770,908,521,908,908,908,908,908,908,908,783,783,783,783,771,146,518',
    868 '245,772,783,783,146,518,245,522,146,518,245,783,783,773,775,290,290',
    869 '290,290,290,290,290,290,776,290,129,128,780,290,523,290,290,290,290',
    870 '290,290,290,207,207,207,207,207,207,207,207,781,207,126,124,123,207',
    871 '581,207,207,207,207,207,207,207,510,510,510,783,170,170,170,170,170',
    872 '170,170,793,510,510,510,510,510,510,908,207,207,207,207,207,207,207',
     791'291,291,291,291,291,291,808,291,625,176,625,291,291,291,291,291,291',
     792'291,291,392,778,573,539,539,172,839,470,294,692,172,366,561,86,512,561',
     793'86,808,291,291,291,176,291,291,264,291,264,291,392,553,573,720,720,720',
     794'720,720,720,720,720,874,720,291,366,291,720,291,720,720,720,720,720',
     795'720,720,294,294,294,841,294,294,294,294,902,902,902,902,902,902,902',
     796'902,880,902,553,561,876,902,553,902,902,902,902,902,902,902,877,841',
     797'599,889,889,889,889,889,889,889,889,210,889,210,880,210,889,720,889',
     798'889,889,889,889,889,889,521,521,521,521,521,521,521,521,599,521,878',
     799'577,720,521,568,521,521,521,521,521,521,521,430,743,743,751,157,262',
     800'430,720,148,881,430,148,522,522,522,522,522,522,522,522,577,522,882',
     801'568,102,522,720,522,522,522,522,522,522,522,751,157,262,902,523,523',
     802'523,523,523,523,523,523,883,523,653,278,834,523,102,523,523,523,523',
     803'523,523,523,879,894,889,897,879,580,653,898,580,801,234,234,234,234',
     804'234,234,234,234,653,234,278,834,901,234,521,234,234,234,234,234,234',
     805'234,166,166,166,166,166,166,166,166,801,166,657,626,784,166,904,166',
     806'166,166,166,166,166,166,115,716,518,476,522,905,476,477,518,906,477',
     807'756,518,434,1,452,127,909,784,657,626,3,127,494,494,234,127,756,115',
     808'716,523,479,479,479,479,479,479,479,479,756,479,434,479,452,479,234',
     809'479,479,479,479,479,479,479,8,358,358,358,358,358,358,358,358,234,358',
     810'520,520,520,358,9,358,358,358,358,358,358,358,363,363,363,363,363,363',
     811'363,363,166,363,254,254,254,363,16,363,363,363,363,363,363,363,360,360',
     812'360,360,360,360,360,360,375,360,222,222,38,360,68,360,360,360,360,360',
     813'360,360,505,505,69,361,361,361,361,361,361,361,361,70,361,72,375,73',
     814'361,479,361,361,361,361,361,361,361,74,682,682,682,682,682,682,682,682',
     815'76,682,223,223,77,682,358,682,682,682,682,682,682,682,862,862,862,862',
     816'862,862,862,862,79,862,265,265,80,862,363,862,862,862,862,862,862,862',
     817'362,362,362,362,362,362,362,362,84,362,225,225,94,362,360,362,362,362',
     818'362,362,362,362,489,489,95,797,797,797,797,797,797,797,797,100,797,490',
     819'490,101,797,361,797,797,797,797,797,797,797,104,811,811,811,811,811',
     820'811,811,811,106,811,497,497,108,811,682,811,811,811,811,811,811,811',
     821'838,838,838,838,838,838,838,838,110,838,549,297,114,838,862,838,838',
     822'838,838,838,838,838,491,491,797,684,684,117,549,181,181,297,297,297',
     823'297,297,362,487,549,118,221,119,487,487,797,221,221,796,796,796,796',
     824'796,796,796,796,122,796,492,492,123,796,797,796,796,796,796,796,796',
     825'796,124,835,835,835,835,835,835,835,835,126,835,128,835,129,835,811',
     826'835,835,835,835,835,835,835,514,514,514,514,514,514,514,514,318,514',
     827'82,82,131,514,838,514,514,514,514,514,514,514,488,133,796,389,389,488',
     828'488,318,318,318,318,823,823,823,823,823,823,823,823,564,823,136,796',
     829'137,823,138,823,823,823,823,823,823,823,495,495,495,495,742,742,796',
     830'564,564,564,564,224,224,224,224,207,207,207,207,207,207,207,207,547',
     831'207,510,510,510,207,835,207,207,207,207,207,207,207,510,510,510,510',
     832'510,510,547,547,547,547,547,546,546,546,514,546,546,546,546,207,207',
    873833'207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207',
    874 '207,207,207,207,122,119,799,118,117,207,207,207,207,207,207,207,207',
    875 '114,810,290,110,108,814,815,816,817,821,211,211,211,211,211,211,211',
    876 '211,822,211,106,104,101,211,207,211,211,211,211,211,211,211,212,212',
    877 '212,212,212,212,212,212,828,212,833,100,95,212,836,212,212,212,212,212',
    878 '212,212,902,902,902,902,902,902,902,902,837,902,94,84,840,902,80,902',
    879 '902,902,902,902,902,902,591,591,591,591,591,591,591,591,79,591,845,846',
    880 '77,591,850,591,591,591,591,591,591,591,76,852,853,855,575,575,575,575',
    881 '575,575,575,575,74,575,73,860,861,575,211,575,575,575,575,575,575,575',
    882 '234,234,234,234,234,234,234,234,72,234,863,70,869,234,212,234,234,234',
    883 '234,234,234,234,584,584,584,584,584,584,584,584,872,584,873,584,874',
    884 '584,902,584,584,584,584,584,584,584,514,514,514,514,514,514,514,514',
    885 '876,514,877,878,69,514,591,514,514,514,514,514,514,514,68,881,882,234',
    886 '162,162,162,162,162,162,162,162,162,162,162,4,883,38,575,16,431,4,432',
    887 '234,428,4,365,365,365,365,365,365,365,365,437,365,442,443,426,365,234',
    888 '365,365,365,365,365,365,365,364,364,364,364,364,364,364,364,425,364',
    889 '446,419,416,364,584,364,364,364,364,364,364,364,363,363,363,363,363',
    890 '363,363,363,,363,,,,363,514,363,363,363,363,363,363,363,838,838,838',
    891 '838,838,838,838,838,,838,,,,838,,838,838,838,838,838,838,838,,,,,835',
    892 '835,835,835,835,835,835,835,,835,,835,,835,365,835,835,835,835,835,835',
    893 '835,362,362,362,362,362,362,362,362,,362,,,,362,364,362,362,362,362',
    894 '362,362,362,361,361,361,361,361,361,361,361,,361,,,,361,363,361,361',
    895 '361,361,361,361,361,823,823,823,823,823,823,823,823,,823,,,,823,838',
    896 '823,823,823,823,823,823,823,,,,,360,360,360,360,360,360,360,360,,360',
    897 ',,,360,835,360,360,360,360,360,360,360,811,811,811,811,811,811,811,811',
    898 ',811,,,,811,362,811,811,811,811,811,811,811,669,669,669,669,,424,,,',
    899 '669,669,424,,,361,424,,,669,669,,,,,,,,,,,,,,,,,823,54,54,54,54,54,54',
    900 '54,54,54,54,54,,,,478,478,,478,,,,,,,478,360,,,,,,,669,,,,,,54,54,54',
    901 '54,54,54,54,,,811,478,478,478,478,478,478,478,478,478,478,478,478,478',
    902 '478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,150,,150',
    903 ',,478,478,478,478,478,478,478,478,,,,,,,,,,,,,,,,,,,,,150,150,150,150',
     834'207,207,207,207,207,207,207,207,207,823,496,496,496,496,207,207,207',
     835'207,207,207,207,207,748,748,748,748,748,748,748,748,139,748,493,493',
     836'141,748,144,748,748,748,748,748,748,748,151,152,207,859,859,859,859',
     837'859,859,859,859,159,859,160,164,165,859,167,859,859,859,859,859,859',
     838'859,575,575,575,575,575,575,575,575,168,575,169,173,174,575,175,575',
     839'575,575,575,575,575,575,748,177,178,179,183,184,257,257,257,257,257',
     840'257,257,257,189,257,195,198,206,257,748,257,257,257,257,257,257,257',
     841'226,581,581,581,581,581,581,581,581,748,581,227,581,228,581,229,581',
     842'581,581,581,581,581,581,729,729,729,729,729,729,729,729,235,729,236',
     843'859,240,729,242,729,729,729,729,729,729,729,256,584,584,584,584,584',
     844'584,584,584,266,584,575,584,271,584,272,584,584,584,584,584,584,584',
     845'274,276,147,147,147,147,147,147,147,147,280,147,281,282,283,147,257',
     846'147,147,147,147,147,147,147,284,591,591,591,591,591,591,591,591,285',
     847'591,306,307,309,591,581,591,591,591,591,591,591,591,719,719,719,719',
     848'719,719,719,719,324,719,326,719,327,719,729,719,719,719,719,719,719',
     849'719,334,288,147,602,246,246,246,288,335,602,337,288,338,602,342,584',
     850'246,246,246,246,246,246,147,343,368,714,714,714,714,714,714,714,714',
     851'380,714,381,382,383,714,147,714,714,714,714,714,714,714,384,710,710',
     852'710,710,710,710,710,710,394,710,395,396,401,710,591,710,710,710,710',
     853'710,710,710,706,706,706,706,706,706,706,706,402,706,407,408,409,706',
     854'719,706,706,706,706,706,706,706,504,504,504,504,504,504,504,504,410',
     855'504,411,412,413,504,414,504,504,504,504,504,504,504,416,419,425,365',
     856'365,365,365,365,365,365,365,426,365,428,431,432,365,714,365,365,365',
     857'365,365,365,365,827,827,827,827,437,442,443,446,450,827,827,783,783',
     858'783,783,710,454,460,827,827,783,783,504,504,461,4,696,462,373,783,783',
     859'4,696,146,373,4,696,706,373,146,463,465,504,146,472,630,630,630,630',
     860'630,630,630,630,480,630,483,630,498,630,504,630,630,630,630,630,630',
     861'630,499,500,827,364,364,364,364,364,364,364,364,501,364,783,502,525',
     862'364,365,364,364,364,364,364,364,364,908,908,908,908,908,908,908,908',
     863'526,908,529,530,531,908,533,908,908,908,908,908,908,908,341,341,341',
     864'341,341,341,341,341,534,341,535,536,537,341,538,341,341,341,341,341',
     865'341,341,543,739,739,739,739,544,548,88,424,557,739,739,739,88,424,630',
     866'559,88,424,739,739,565,570,572,578,583,347,347,347,347,347,347,347,347',
     867'586,347,588,598,600,347,364,347,347,347,347,347,347,347,345,345,345',
     868'345,345,345,345,345,604,345,605,606,607,345,908,345,345,345,345,345',
     869'345,345,739,162,162,162,162,162,162,162,162,162,162,162,608,610,341',
     870'611,616,619,632,345,345,345,345,345,345,345,345,345,345,345,345,345',
     871'345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,634,636',
     872'637,638,640,345,345,345,345,345,345,345,345,641,643,347,260,260,260',
     873'260,260,260,260,348,348,348,348,348,348,348,348,644,348,646,648,651',
     874'348,345,348,348,348,348,348,348,348,349,349,349,349,349,349,349,349',
     875'658,349,662,663,664,349,665,349,349,349,349,349,349,349,350,350,350',
     876'350,350,350,350,350,666,350,668,671,673,350,688,350,350,350,350,350',
     877'350,350,351,351,351,351,351,351,351,351,689,351,693,694,695,351,697',
     878'351,351,351,351,351,351,351,699,700,701,707,352,352,352,352,352,352',
     879'352,352,711,352,718,725,727,352,348,352,352,352,352,352,352,352,353',
     880'353,353,353,353,353,353,353,730,353,731,746,749,353,349,353,353,353',
     881'353,353,353,353,354,354,354,354,354,354,354,354,750,354,755,760,761',
     882'354,350,354,354,354,354,354,354,354,355,355,355,355,355,355,355,355',
     883'763,355,764,766,767,355,351,355,355,355,355,355,355,355,768,769,770',
     884'771,356,356,356,356,356,356,356,356,772,356,773,775,776,356,352,356',
     885'356,356,356,356,356,356,357,357,357,357,357,357,357,357,780,357,781',
     886'793,799,357,353,357,357,357,357,357,357,357,359,359,359,359,359,359',
     887'359,359,810,359,814,815,816,359,354,359,359,359,359,359,359,359,149',
     888'149,149,149,149,149,149,149,817,149,821,149,822,149,355,149,149,149',
     889'149,149,149,149,828,833,836,837,474,474,474,474,474,474,474,474,840',
     890'474,845,846,850,474,356,474,474,474,474,474,474,474,290,290,290,290',
     891'290,290,290,290,,290,,,,290,357,290,290,290,290,290,290,290,848,848',
     892'848,848,848,848,848,848,,848,,,,848,359,848,848,848,848,848,848,848',
     893'806,806,806,806,806,806,806,806,,806,,,,806,149,806,806,806,806,806',
     894'806,806,245,,,,,,245,,,253,245,669,669,669,669,253,,,474,253,669,669',
     895',,,848,,,,669,669,170,170,170,170,170,170,170,,,290,,,,,848,,,403,403',
     896'403,403,403,403,403,403,,403,,,,403,848,403,403,403,403,403,403,403',
     897'513,513,513,513,513,513,513,513,,513,669,,,513,806,513,513,513,513,513',
     898'513,513,212,212,212,212,212,212,212,212,,212,,,,212,,212,212,212,212',
     899'212,212,212,211,211,211,211,211,211,211,211,,211,,,,211,,211,211,211',
     900'211,211,211,211,,,,464,464,464,464,464,464,464,464,464,464,464,,,,,403',
     901',,,,,,54,54,54,54,54,54,54,54,54,54,54,,,,,513,464,464,464,464,464,464',
     902'464,,,,478,478,,478,,,,,,,478,212,54,54,54,54,54,54,54,36,36,36,36,36',
     903'36,36,36,36,36,36,36,36,36,211,478,478,478,478,478,478,478,478,478,478',
     904'478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478',
     905'478,582,,582,,,478,478,478,478,478,478,478,478,,,,,,,,,,,,,,,,,,,,,582',
     906'582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582',
     907'582,582,582,582,582,582,582,582,582,582,150,,150,,,582,582,582,582,582',
     908'582,582,582,,,,,,,,,,,,,,,,,,,,,150,150,150,150,150,150,150,150,150',
    904909'150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150',
    905 '150,150,150,150,150,150,150,582,,582,,,150,150,150,150,150,150,150,150',
    906 ',,,,,,,,,,,,,,,,,,,,582,582,582,582,582,582,582,582,582,582,582,582',
    907 '582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,372',
    908 ',,,,582,582,582,582,582,582,582,582,,,,,,,,,,,,,,,,,,,372,372,372,372',
     910'150,150,372,,,,,150,150,150,150,150,150,150,150,,,,,,,,,,,,,,,,,,,372',
    909911'372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372',
    910 '372,372,372,372,372,372,372,459,,,,,372,372,372,372,372,372,372,372',
    911 '372,,,,,,,,,,,,,,,,,,459,459,459,459,459,459,459,459,459,459,459,459',
    912 '459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,250',
    913 ',,,,459,459,459,459,459,459,459,459,,,,,,,,,,,,,,,,,,,250,250,250,250',
     912'372,372,372,372,372,372,372,372,372,372,293,,,,,372,372,372,372,372',
     913'372,372,372,372,,,,,,,,,,,,,,,,,,293,293,293,293,293,293,293,293,293',
     914'293,293,293,293,293,293,293,293,293,293,293,293,293,293,293,293,293',
     915'293,293,444,293,,,,293,293,293,293,293,293,293,293,,,,,,,,,,,,,,,,,',
     916',444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444',
     917'444,444,444,444,444,444,444,444,444,444,444,445,,,,,444,444,444,444',
     918'444,444,444,444,,,,,,,,,,,,,,,,,,,445,445,445,445,445,445,445,445,445',
     919'445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445',
     920'445,445,550,,,,,445,445,445,445,445,445,445,445,,,,,,,,,,,,,,,,,,,550',
     921'550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550',
     922'550,550,550,550,550,550,550,550,550,550,554,550,,,,550,550,550,550,550',
     923'550,550,550,,,,,,,,,,,,,,,,,,,554,554,554,554,554,554,554,554,554,554',
     924'554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554',
     925'554,566,554,,,,554,554,554,554,554,554,554,554,,,,,,,,,,,,,,,,,,,566',
     926'566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,566',
     927'566,566,566,566,566,566,566,566,566,566,71,566,,,,566,566,566,566,566',
     928'566,566,566,,,,,,,,,,,,,,,,,,,71,71,71,71,71,71,71,71,71,71,71,71,71',
     929'71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,386,,,,,71,71,71,71,71',
     930'71,71,71,,,,,,,,,,,,,,,,,,,386,386,386,386,386,386,386,386,386,386,386',
     931'386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386',
     932'459,386,,,,386,386,386,386,386,386,386,386,,,,,,,,,,,,,,,,,,,459,459',
     933'459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459',
     934'459,459,459,459,459,459,459,459,459,251,,,,,459,459,459,459,459,459',
     935'459,459,,,,,,,,,,,,,,,,,,,251,251,251,251,251,251,251,251,251,251,251',
     936'251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251',
     937'250,251,,,,251,251,251,251,251,251,251,251,,,,,,,,,,,,,,,,,,,250,250',
    914938'250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250',
    915 '250,250,250,250,250,250,250,293,,,,,250,250,250,250,250,250,250,250',
    916 ',,,,,,,,,,,,,,,,,,293,293,293,293,293,293,293,293,293,293,293,293,293',
    917 '293,293,293,293,293,293,293,293,293,293,293,293,293,293,293,445,293',
    918 ',,,293,293,293,293,293,293,293,293,,,,,,,,,,,,,,,,,,,445,445,445,445',
    919 '445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445',
    920 '445,445,445,445,445,445,445,251,,,,,445,445,445,445,445,445,445,445',
    921 ',,,,,,,,,,,,,,,,,,251,251,251,251,251,251,251,251,251,251,251,251,251',
    922 '251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,444,251',
    923 ',,,251,251,251,251,251,251,251,251,,,,,,,,,,,,,,,,,,,444,444,444,444',
    924 '444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444',
    925 '444,444,444,444,444,444,444,156,,,,,444,444,444,444,444,444,444,444',
    926 ',,,,,,,,,,,,,,,,,,156,156,156,156,156,156,156,156,156,156,156,156,156',
    927 '156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,386,,,,',
    928 '156,156,156,156,156,156,156,156,,,,,,,,,,,,,,,,,,,386,386,386,386,386',
    929 '386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386',
    930 '386,386,386,386,386,386,71,386,,,,386,386,386,386,386,386,386,386,,',
    931 ',,,,,,,,,,,,,,,,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71',
    932 '71,71,71,71,71,71,71,71,71,71,550,,,,,71,71,71,71,71,71,71,71,,,,,,',
    933 ',,,,,,,,,,,,550,550,550,550,550,550,550,550,550,550,550,550,550,550',
    934 '550,550,550,550,550,550,550,550,550,550,550,550,550,550,554,550,,,,550',
    935 '550,550,550,550,550,550,550,,,,,,,,,,,,,,,,,,,554,554,554,554,554,554',
    936 '554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554',
    937 '554,554,554,554,554,566,554,,,,554,554,554,554,554,554,554,554,,,,,',
    938 ',,,,,,,,,,,,,566,566,566,566,566,566,566,566,566,566,566,566,566,566',
    939 '566,566,566,566,566,566,566,566,566,566,566,566,566,566,,566,,,,566',
    940 '566,566,566,566,566,566,566,464,464,464,464,464,464,464,464,464,464',
    941 '464,,,,,,,,,,,,,,,,,,,,,,,,,,,,464,464,464,464,464,464,464,244,244,244',
     939'250,250,250,250,250,250,250,250,250,156,,,,,250,250,250,250,250,250',
     940'250,250,,,,,,,,,,,,,,,,,,,156,156,156,156,156,156,156,156,156,156,156',
     941'156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156',
     942',,,,,156,156,156,156,156,156,156,156,622,622,622,622,622,622,622,622',
     943'622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,622',
     944'622,622,622,,,,,,622,622,622,622,622,622,622,622,40,40,40,40,40,40,40',
     945'40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,,,,,',
     946'40,40,40,40,40,40,40,40,705,705,705,705,705,705,705,705,705,705,705',
     947'705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705',
     948',,,,,705,705,705,705,705,705,705,705,244,244,244,244,244,244,244,244',
    942949'244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244',
    943 '244,244,244,244,244,244,244,244,,,,,,244,244,244,244,244,244,244,244',
    944 '40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40',
    945 '40,40,40,40,40,,,,,,40,40,40,40,40,40,40,40,289,289,289,289,289,289',
    946 '289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289',
    947 '289,289,289,289,289,,,,,,289,289,289,289,289,289,289,289,709,709,709',
     950'244,244,244,,,,,,244,244,244,244,244,244,244,244,519,519,519,519,519',
     951'519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519',
     952'519,519,519,519,519,519,,,,,,519,519,519,519,519,519,519,519,709,709',
    948953'709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709',
    949 '709,709,709,709,709,709,709,709,,,,,,709,709,709,709,709,709,709,709',
    950 '519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519',
    951 '519,519,519,519,519,519,519,519,519,519,519,,,,,,519,519,519,519,519',
    952 '519,519,519,622,622,622,622,622,622,622,622,622,622,622,622,622,622',
    953 '622,622,622,622,622,622,622,622,622,622,622,622,622,622,,,,,,622,622',
    954 '622,622,622,622,622,622,705,705,705,705,705,705,705,705,705,705,705',
    955 '705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705',
    956 ',,,,,705,705,705,705,705,705,705,705,239,239,239,239,239,239,239,239',
    957 '239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239',
    958 '239,239,239,,,,,,239,239,239,239,239,239' ]
    959         racc_action_check = arr = ::Array.new(3623, nil)
     954'709,709,709,709,709,709,709,709,709,,,,,,709,709,709,709,709,709,709',
     955'709,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289',
     956'289,289,289,289,289,289,289,289,289,289,289,289,,,,,,289,289,289,289',
     957'289,289,289,289,239,239,239,239,239,239,239,239,239,239,239,239,239',
     958'239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,,,,,,239',
     959'239,239,239,239,239' ]
     960        racc_action_check = arr = ::Array.new(3593, nil)
    960961        idx = 0
    961962        clist.each do |str|
     
    967968
    968969racc_action_pointer = [
    969    nil,  1442,    -1,  1586,  1989,   nil,   nil,   nil,   602,   527,
    970    nil,   nil,   nil,   nil,   nil,   nil,  1993,   nil,   nil,   nil,
     970   nil,   613,    -1,   620,  1492,   nil,   nil,   nil,   612,   627,
     971   nil,   nil,   nil,   nil,   nil,   nil,   680,   nil,   nil,   nil,
    971972   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    972    nil,   nil,   nil,   nil,   nil,   nil,  1340,   nil,  1985,   nil,
    973   3295,   123,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    974    nil,   nil,   nil,   nil,  2182,   nil,   nil,   nil,   nil,   nil,
    975    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,  1974,  1964,
    976   1919,  2991,  1910,  1890,  1888,   198,  1876,  1866,   nil,  1806,
    977   1852,   nil,   679,   nil,  1816,   122,   655,   nil,   607,   174,
    978    nil,   nil,   190,   nil,  1786,  1766,   nil,   nil,   nil,   nil,
    979   1821,  1744,   550,   nil,  1805,   nil,  1804,   nil,  1788,   nil,
    980   1787,   nil,   nil,   nil,  1784,   587,   nil,  1775,  1774,  1772,
    981    nil,   nil,  1771,  1714,  1711,    77,  1706,   350,  1627,  1628,
    982    nil,  1558,   nil,  1538,   nil,   nil,  1592,  1477,  1549,  1481,
    983    nil,  1480,   nil,   nil,  1539,   nil,  1663,  1133,   285,  1177,
    984   2340,  1531,  1520,   nil,    27,   nil,  2873,    45,   nil,  1495,
    985   1520,   271,  1895,   nil,  1502,  1505,  1481,  1500,  1478,  1312,
    986   1607,   538,   476,  1423,  1344,  1343,   525,  1328,  1300,  1260,
    987    nil,   692,   nil,  1287,  1290,   184,   nil,   156,   nil,  1276,
    988    450,   nil,    -6,   nil,   -65,  1277,   nil,   nil,  1159,   nil,
    989    nil,   nil,   nil,   nil,   nil,   nil,  1232,  1709,   nil,   nil,
    990    437,  1801,  1823,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    991    nil,   590,   741,   751,   893,   767,  1204,  1186,  1174,  1157,
    992    774,   nil,   nil,   nil,  1915,  1178,  1155,   nil,   nil,  3541,
    993   1157,   nil,  1124,   nil,  3254,  1665,  1017,   nil,   nil,   nil,
    994   2578,  2755,   nil,   592,   612,   nil,  1131,   414,   149,   nil,
    995   1324,   nil,   248,   nil,   332,   814,  1135,   271,   nil,   599,
    996    nil,  1102,  1119,   nil,  1081,   nil,  1079,   nil,   430,   nil,
    997   1069,  1098,  1060,  1088,  1055,  1035,   176,   nil,  1322,  3336,
    998   1687,    97,   nil,  2637,   291,   nil,   nil,   802,   nil,   nil,
    999    nil,   nil,   nil,    80,   nil,   nil,  1002,   984,   177,   980,
    1000    nil,   nil,   nil,   nil,   nil,   183,   nil,   nil,   797,   nil,
    1001    nil,   nil,   nil,   nil,   961,   199,   900,   857,   nil,    -2,
    1002    nil,   nil,   nil,   254,   858,   787,   nil,   840,   838,   nil,
    1003    206,  1503,   829,   811,   nil,  1367,   nil,  1300,  1253,  1208,
    1004   1155,  1110,   993,   971,   949,   926,   857,   787,   720,   695,
    1005   2191,  2143,  2121,  2051,  2029,  2007,   447,   nil,   811,   nil,
    1006    nil,   nil,  2460,  1321,   nil,   342,   nil,   nil,   nil,   nil,
    1007    804,   792,   788,   770,   754,   nil,  2932,   nil,   nil,   806,
    1008    nil,   nil,   330,   nil,   654,   643,   524,   nil,   nil,   nil,
    1009    nil,   516,   470,   461,   nil,   nil,   nil,   458,   381,   423,
    1010    383,   308,   359,   271,    69,   nil,  2032,   nil,   nil,  2032,
    1011    nil,   nil,   -37,   nil,  2233,  2029,  1981,   nil,  1967,   nil,
    1012   1078,  1893,  1965,   nil,     0,   nil,   nil,  2008,   nil,   nil,
    1013    nil,   nil,  1911,  2005,  2814,  2696,  1999,    73,   nil,   nil,
    1014    -32,   nil,   599,   nil,    31,   nil,   nil,   nil,   nil,  2519,
    1015    -16,   155,   192,   255,  3160,   328,   nil,   nil,   nil,    -8,
    1016     81,   nil,   370,   nil,   439,   nil,   596,   537,  2279,   495,
    1017    474,   nil,   nil,   484,   nil,   nil,   nil,   741,   526,   849,
    1018    861,   871,   900,   912,   935,   856,   717,   951,   671,   671,
    1019    676,   685,   710,   nil,   553,   995,   nil,   nil,   nil,   nil,
    1020   1660,   253,   197,   651,  1959,  1459,   nil,   nil,  1664,  3418,
    1021    634,  1551,  1573,  1595,   nil,   874,   891,   nil,   892,   877,
    1022    925,   930,   nil,   940,   953,   940,   975,   947,   992,   977,
    1023    nil,   nil,   nil,   969,  1006,   nil,  1084,   638,  1027,   587,
    1024   3050,   nil,   nil,   310,  3109,   nil,   nil,  1003,    78,  1081,
    1025     13,   284,   nil,    92,   642,  1096,  3168,   nil,   305,   nil,
    1026   1109,   nil,   996,    77,   nil,  1893,   -11,   130,  1108,   nil,
    1027    484,  1617,  2401,  1159,  1937,   nil,  1179,   nil,  1178,   nil,
    1028    nil,  1867,   nil,   nil,   nil,   nil,    14,    26,  1211,   356,
    1029   1222,   nil,  1079,   nil,  1234,  1235,  1237,  1250,  1252,   448,
    1030    nil,  1198,   nil,     0,   nil,   nil,  1277,   nil,   nil,  1279,
    1031    nil,   nil,  3459,   nil,   nil,   346,   524,   nil,   nil,   nil,
    1032     12,    79,  1272,   nil,  1300,   nil,  1305,  1286,  1289,   nil,
    1033   1319,  1326,    25,  1304,  1305,   nil,  1337,   nil,  1315,   nil,
    1034    nil,  1231,   nil,   465,   nil,   nil,   nil,   577,  1337,   nil,
    1035    nil,   nil,  1364,  1365,  1256,  1350,  1377,   nil,  1398,  2235,
    1036    nil,  1426,   nil,  1430,   nil,   nil,   nil,   nil,   nil,   nil,
    1037    nil,   nil,  1525,   nil,   387,   nil,   nil,   nil,  1409,  1437,
    1038    nil,  1454,  1456,  1432,  1463,  1451,   887,  1479,   nil,  1480,
    1039   1457,  1500,   nil,    24,   nil,  3500,  1345,  1448,   nil,  3377,
    1040   1275,  1523,   nil,   nil,  1231,   nil,   496,   nil,  1540,  1063,
    1041    384,    76,   nil,   nil,   nil,  1521,   nil,  1549,   nil,  1041,
    1042   1437,  1544,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   888,
    1043    nil,   nil,  1026,  1049,   nil,   nil,  1595,   nil,  1018,  1594,
    1044    nil,   548,   nil,   nil,   nil,  1587,   262,   nil,   nil,   nil,
    1045   1591,  1626,   nil,  1632,  1632,   nil,  1634,  1613,  1614,  1641,
    1046   1531,  1656,  1633,  1674,   nil,  1648,  1683,    75,   352,   nil,
    1047   1686,  1678,   115,  1665,   344,   nil,   nil,   nil,   nil,   nil,
    1048    nil,   nil,   nil,  1729,   nil,   nil,   834,   812,   nil,  1742,
    1049    nil,   547,   nil,   nil,   nil,   nil,   765,   nil,   330,   nil,
    1050   1753,  2213,   229,   nil,  1783,  1784,  1672,  1761,   nil,   nil,
    1051    nil,  1674,  1771,  2165,     8,   nil,   nil,  1322,  1791,   nil,
    1052    nil,   nil,   nil,  1824,   544,  2099,  1828,  1815,  2073,    89,
    1053   1819,   598,   nil,   -13,   nil,  1838,  1865,   nil,   673,   nil,
    1054   1843,   205,  1879,  1883,   nil,  1854,    -9,   nil,   nil,   628,
    1055   1892,  1867,   575,  1917,   nil,   nil,   464,   nil,   nil,  1887,
    1056    nil,   nil,  1932,  1936,  1936,   nil,  1959,  1900,  1932,   591,
    1057    399,  1944,  1945,  1928,   nil,   nil,   nil,   nil,   nil,   521,
    1058    nil,   nil,   nil,    11,   539,   100,   nil,   595,   581,   nil,
    1059    nil,   614,  1845,   nil,   650,   765,   966,   nil,  1643,  1577,
     973   nil,   nil,   nil,   nil,   nil,   nil,  2268,   nil,   694,   nil,
     974  3265,   123,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     975   nil,   nil,   nil,   nil,  2185,   nil,   nil,   nil,   nil,   nil,
     976   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   702,   712,
     977   721,  2888,   717,   719,   729,   115,   738,   742,   nil,   704,
     978   770,   nil,   921,   nil,   755,    75,   359,   nil,  1610,   174,
     979   nil,   nil,    89,   nil,   730,   742,   nil,   nil,   nil,   nil,
     980   807,   755,   496,   nil,   827,   nil,   836,   nil,   840,   nil,
     981   858,   nil,   nil,   nil,   862,   586,   nil,   877,   889,   891,
     982   nil,   nil,   905,   909,   917,    27,   922,   606,   866,   870,
     983   nil,   892,   nil,   903,   nil,   nil,   979,   888,   983,  1040,
     984   nil,  1044,   nil,   nil,  1106,   nil,  1500,  1268,   484,  2000,
     985  2416,  1115,  1107,   nil,    26,   nil,  3183,   448,   nil,  1094,
     986  1123,    97,  1591,   nil,  1124,  1129,   575,  1127,  1143,  1031,
     987  2017,   282,   350,  1146,  1147,  1149,   335,  1163,  1164,  1134,
     988   nil,   848,   nil,  1163,  1168,   184,   nil,   156,   nil,  1171,
     989   218,   nil,    -6,   nil,   -65,  1178,   nil,   nil,  1081,   nil,
     990   nil,   nil,   nil,   nil,   nil,   nil,  1179,  1019,   nil,   nil,
     991   437,  2228,  2206,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     992   nil,   880,   687,   729,   989,   767,  1182,  1177,  1178,  1179,
     993   132,   nil,   nil,   nil,   553,  1222,  1220,   nil,   nil,  3511,
     994  1225,   nil,  1196,   nil,  3347,  2107,  1268,   nil,   nil,   nil,
     995  3124,  3065,   nil,  2116,   612,   nil,  1230,  1176,   130,   nil,
     996  1615,   nil,   480,   nil,   367,   767,  1244,    76,   nil,    -1,
     997   nil,  1217,  1245,   nil,  1227,   nil,  1228,   nil,   524,   nil,
     998  1237,  1270,  1241,  1271,  1252,  1261,   197,   nil,  1329,  3470,
     999  2048,   271,   nil,  2534,   291,   nil,   nil,   778,   nil,   nil,
     1000   nil,   nil,   nil,   177,   nil,   nil,  1232,  1233,   198,  1234,
     1001   nil,   nil,   nil,   nil,   nil,   183,   nil,   nil,   867,   nil,
     1002   nil,   nil,   nil,   nil,  1252,    10,  1197,  1313,   nil,    -2,
     1003   nil,   nil,   nil,   190,  1328,  1274,   nil,  1337,  1339,   nil,
     1004   206,  1588,  1336,  1345,   nil,  1658,   nil,  1636,  1750,  1772,
     1005  1794,  1816,  1842,  1864,  1886,  1908,  1934,  1956,   651,  1978,
     1006   695,   720,   787,   673,  1544,  1452,   325,   nil,  1350,   nil,
     1007   nil,   nil,  2475,  1495,   nil,   692,   nil,   nil,   nil,   nil,
     1008  1361,  1363,  1364,  1365,  1375,   nil,  2947,   nil,   nil,   936,
     1009   nil,   nil,   342,   nil,  1384,  1386,  1387,   nil,   nil,   nil,
     1010   nil,  1382,  1400,  2162,   nil,   nil,   nil,  1402,  1347,  1404,
     1011  1426,  1368,  1429,  1430,  1428,   nil,  1440,   nil,   nil,  1442,
     1012   nil,   nil,   -37,   nil,  1611,  1443,  1422,   nil,  1424,   nil,
     1013   476,  1355,  1426,   nil,   599,   nil,   nil,  1471,   nil,   nil,
     1014   nil,   nil,  1373,  1467,  2593,  2652,  1441,   -11,   nil,   nil,
     1015  1444,   nil,   601,   nil,  1483,   nil,   nil,   nil,   nil,  3006,
     1016  1385,  1485,  1488,  1501,  2163,  1477,   nil,   nil,   nil,    -8,
     1017   254,   nil,  1509,   nil,  2026,   nil,   593,   597,  2294,   628,
     1018  1516,   nil,   nil,  1521,   nil,   nil,   nil,   877,   954,   791,
     1019   804,   855,   890,  1087,   596,   978,  1063,   815,  1515,  1509,
     1020  1509,  1518,  1518,   nil,  1427,   709,   nil,   nil,   nil,   nil,
     1021   958,    81,   261,  2184,   949,    12,   nil,   nil,   592,  3388,
     1022   590,   461,   495,   521,   nil,  1544,  1563,   nil,    80,  1536,
     1023  1568,  1570,   nil,  1572,  1588,  1559,  1591,  1562,  1593,   318,
     1024   nil,   nil,   nil,  1572,  1604,   nil,   937,   937,  1603,   857,
     1025  2711,   nil,   nil,   310,  2770,   nil,   nil,  1547,    79,  1613,
     1026    13,   355,   nil,    92,   900,  1618,  2829,   nil,   437,   nil,
     1027  1620,   nil,  1507,   344,   nil,  1148,    73,   433,  1597,   nil,
     1028   541,  1199,  2355,  1627,  1244,   nil,  1636,   nil,  1635,   nil,
     1029   nil,  1291,   nil,   nil,   nil,   nil,    14,    27,  1639,   430,
     1030  1640,   nil,  1331,   nil,  1658,  1660,  1661,  1657,  1680,   240,
     1031  1587,  1626,   nil,     0,   nil,   nil,  1687,   nil,   nil,  1689,
     1032   nil,   nil,  3224,   nil,   nil,   332,   578,   nil,   nil,   nil,
     1033  1519,    78,  1660,   nil,  1716,   nil,  1721,  1689,  1692,   nil,
     1034  1720,  1733,    75,  1703,  1720,   nil,  1753,   nil,  1723,   nil,
     1035   nil,  1638,   nil,   521,   nil,   nil,   nil,   577,  1742,   nil,
     1036   nil,   nil,  1769,  1770,  1661,  1747,  1789,   nil,  1795,  2125,
     1037   nil,  1794,   nil,  1798,   nil,   nil,   nil,   nil,   nil,   nil,
     1038   nil,   nil,   743,   nil,   844,   nil,   nil,   nil,  1768,  1811,
     1039   nil,   176,   256,  1788,  1819,  1790,  1493,  1817,   nil,  1825,
     1040  1801,  1829,   nil,    74,   nil,  3306,  1405,  1772,   nil,  3429,
     1041  1383,  1837,   nil,   nil,  1360,   nil,   587,   nil,  1845,  1313,
     1042   384,    76,   nil,   nil,   nil,  1815,   nil,  1842,   nil,  1221,
     1043  1746,  1837,   nil,   nil,   nil,   nil,   nil,   nil,   nil,  1611,
     1044   nil,   nil,  1006,   482,   nil,   nil,  1867,   nil,  1101,  1864,
     1045  1788,   447,   nil,   nil,   nil,  1858,   596,   nil,   nil,   nil,
     1046  1859,  1885,   nil,  1908,  1909,   nil,  1911,  1882,  1891,  1918,
     1047  1808,  1920,  1902,  1933,   nil,  1907,  1934,    -9,   284,   nil,
     1048  1951,  1927,   199,  1485,   576,   nil,   nil,   nil,   nil,   nil,
     1049   nil,   nil,   nil,  1954,   nil,   nil,   904,   812,   nil,  1930,
     1050   nil,   513,   nil,   nil,   nil,   nil,  2092,   nil,   330,   nil,
     1051  1947,   835,   240,   nil,  1975,  1976,  1864,  1970,   nil,   nil,
     1052   nil,  1884,  1974,   982,     8,   nil,   nil,  1474,  1982,   nil,
     1053   nil,   nil,   nil,  2014,   525,   927,  2015,  1987,   857,   253,
     1054  1996,   399,   nil,   -13,   nil,  1997,  2024,   nil,  2070,   nil,
     1055  2000,   205,    -5,    30,   nil,    52,    25,   nil,   nil,  1126,
     1056   117,    97,   765,   197,   nil,   nil,   180,   nil,   nil,   217,
     1057   nil,   nil,   279,   291,   379,   nil,   418,   367,   433,   534,
     1058   412,   454,   467,   460,   nil,   nil,   nil,   nil,   nil,   439,
     1059   nil,   nil,   nil,    11,   533,   100,   nil,   539,   512,   nil,
     1060   nil,   558,   414,   nil,   576,   594,   567,   nil,  1566,   606,
    10601061   nil ]
    10611062
     
    12001201   665,   nil,   nil,   nil,   nil,   nil,   671,   596,   597,   588,
    12011202   nil,   nil,   553,   557,   673,   nil,   238,   nil,   763,   622,
    1202    853,   nil,   766,   nil,   nil,   nil,   530,   553,   nil,   nil,
     1203   853,   nil,   766,   nil,   610,   nil,   530,   553,   nil,   nil,
    12031204   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    12041205   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   664,   nil,
     
    12161217   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   696,
    12171218   nil,   873,   nil,   792,   nil,   nil,   nil,   nil,   nil,   nil,
    1218    nil,   464,   nil,   nil,   339,   nil,   nil,   nil,   nil,   nil,
     1219   nil,   464,   nil,   nil,   339,   nil,   nil,   750,   610,   nil,
    12191220   nil,   769,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    12201221   nil,   894,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     
    12801281    23,   nil,   nil,   nil,   nil,   nil,    23,     4,     4,    23,
    12811282   nil,   nil,    45,    45,    55,   nil,    28,   nil,     6,    47,
    1282     84,   nil,     6,   nil,   nil,   nil,     5,    45,   nil,   nil,
     1283    84,   nil,     6,   nil,     4,   nil,     5,    45,   nil,   nil,
    12831284   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    12841285   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    47,   nil,
     
    12961297   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    25,
    12971298   nil,     6,   nil,    32,   nil,   nil,   nil,   nil,   nil,   nil,
    1298    nil,    45,   nil,   nil,    22,   nil,   nil,   nil,   nil,   nil,
     1299   nil,    45,   nil,   nil,    22,   nil,   nil,     4,     4,   nil,
    12991300   nil,    47,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    13001301   nil,     6,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
     
    29432944  def _reduce_104(val, _values, result)
    29442945                        # tag が無い場合、内部名を与える
    2945                         result = StructType.new( :"$TAG_#{@@no_struct_tag_num}" )
     2946                        result = StructType.new( :"TAG__#{@@no_struct_tag_num}__" )
    29462947                        @@no_struct_tag_num += 1
    29472948                        StructType.set_define( true )
     
    37493750module_eval(<<'.,.,', 'bnf.y.rb', 802)
    37503751  def _reduce_233(val, _values, result)
    3751         result = [val[0].val]           
     3752        result = [val[0]]               
    37523753    result
    37533754  end
     
    37563757module_eval(<<'.,.,', 'bnf.y.rb', 804)
    37573758  def _reduce_234(val, _values, result)
    3758         result << val[2].val           
     3759        result << val[2]               
    37593760    result
    37603761  end
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/bnf.y.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2016 by TOPPERS Project
     6#   Copyright (C) 2008-2018 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    379379                {
    380380                        # tag が無い場合、内部名を与える
    381                         result = StructType.new( :"$TAG_#{@@no_struct_tag_num}" )
     381                        result = StructType.new( :"TAG__#{@@no_struct_tag_num}__" )
    382382                        @@no_struct_tag_num += 1
    383383                        StructType.set_define( true )
     
    800800
    801801region_name_list
    802         : IDENTIFIER
    803                 {       result = [val[0].val]           }
    804         | region_name_list ',' IDENTIFIER
    805                 {       result << val[2].val            }
     802        : namespace_identifier
     803                {       result = [val[0]]               }
     804        | region_name_list ',' namespace_identifier
     805                {       result << val[2]                }
    806806
    807807const_statement
     
    18071807                  string += line
    18081808                  # この位置では error メソッドは使えない (token 読出し前)
    1809                   puts "error: #{file} line #{lineno}: string literal has newline without escape"
     1809                  puts "#{file}:#{lineno}:#{col}: error: string literal has newline without escape"
    18101810                  @@n_error += 1
    18111811                end
     
    18481848                  b_in_string = true
    18491849                  # この位置では error メソッドは使えない (token 読出し前) # mikan cdl_error ではない
    1850                   puts "error: #{file} line #{lineno}: string literal has newline without escape"
     1850                  puts "#{file}:#{lineno}:#{col}: error: string literal has newline without escape"
    18511851                  @@n_error += 1
    18521852                # 山括弧で囲まれた文字列
    1853                 when /\A<[0-9A-Za-z_\. \/]+>/   # AB: angle bracke
     1853                # when /\A<[0-9A-Za-z_\. \/]+>/   # AB: angle bracke
     1854                when /\A<(?:[^>\\]|\\.)*>/   # これはうまく行くようだ
    18541855                  @q << [:AB_STRING_LITERAL, Token.new($&, file, lineno, col)]
    18551856                # 行コメント
     
    19811982      end
    19821983      if locale then
    1983         Console.puts "error: #{locale[0]}: line #{locale[1]} #{msg}"
     1984        Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: error: #{msg}"
    19841985      else
    19851986        Console.puts "error: #{msg}"
     
    20142015      end
    20152016      if locale then
    2016         Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}"
     2017        Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: warning: #{msg}"
    20172018      else
    20182019        Console.puts "warning: #{msg}"
     
    20472048      end
    20482049      if locale then
    2049         Console.puts "info: #{locale[0]}: line #{locale[1]} #{msg}"
     2050        Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: info: #{msg}"
    20502051      else
    20512052        Console.puts "info: #{msg}"
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/componentobj.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2017 by TOPPERS Project
     6#   Copyright (C) 2008-2019 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    149149    end
    150150
    151     set_descriptor_list
     151    # set_descriptor_list ##
    152152
    153153    if @generate then
     
    364364  end
    365365
     366  @@set_descriptor_list = {}
     367  def self.set_descriptor_list
     368    Namespace.get_root.travers_all_signature{ |sig|
     369      if @@set_descriptor_list[ sig ] == nil then
     370        @@set_descriptor_list[ sig ] = true
     371        sig.set_descriptor_list
     372      end
     373    }
     374  end
     375
    366376  #== Signature# 引数で参照されている Descriptor 型のリストを作成する
    367377  def set_descriptor_list
     
    538548# @ct_factory_list::    Factory[] :    celltype factory
    539549# @cell_list:: Cell[] : 定義のみ (V1.0.0.2 以降)
     550# @ordered_cell_list:: Cell[] : ID 順に順序付けされたセルリスト、最適化以降有効 (リンク単位ごとに生成されなおす)
    540551# @singleton:: bool
    541552# @idx_is_id:: bool
    542553# @idx_is_id_act:: bool: actual value
     554# @b_need_ptab:: bool: true if having cells in multi-domain
    543555# @active:: bool
    544556# @b_reuse:: bool :  reuse 指定されて import された(template 不要)
     
    654666    if $idx_is_id then
    655667      @idx_is_id = true
     668      @idx_is_id_act = true
     669      @b_need_ptab = true
    656670    else
    657671      @idx_is_id = false
    658     end
    659     @idx_is_id_act = @idx_is_id
     672      @idx_is_id_act = false
     673      @b_need_ptab = false
     674    end
    660675
    661676    Namespace.new_celltype( self )
     
    700715    end
    701716
    702     check_dynamic_join
     717    # check_dynamic_join ##
    703718
    704719    @@current_object = nil
     
    886901        @idx_is_id = true
    887902        @idx_is_id_act = true
     903        @b_need_ptab = true
    888904      when :ACTIVE
    889905        @active = true
     
    899915    if @singleton then
    900916      @idx_is_id_act = false
     917      @b_need_ptab = false
    901918    end
    902919  end
     
    9991016  end
    10001017
     1018  @@dynamic_join_checked_list = {}
     1019  def self.check_dynamic_join
     1020    Namespace.get_root.travers_all_celltype{ |ct|
     1021      if @@dynamic_join_checked_list[ ct ] == nil then
     1022        @@dynamic_join_checked_list[ ct ] = true
     1023        ct.check_dynamic_join
     1024      end
     1025    }
     1026  end
     1027
    10011028  #=== Celltype#dynamic の適合性チェック
    10021029  def check_dynamic_join
     1030    return if ! $verbose
    10031031    @port.each{ |port|
    10041032      signature = port.get_signature
     
    10381066              end
    10391067            end
    1040             cdl_warning( 'W9999 "$1" cannot handle Descriptor "$2" infromation for port "$3"', @name, param.get_name, port.get_name )
     1068            cdl_warning( 'W9999 "$1" cannot handle Descriptor "$2" information for port "$3"', @name, param.get_name, port.get_name )
    10411069          }
    10421070        end
     
    11431171  #     呼び口(ただし、最適化で不要となるものは除く)
    11441172  def has_INIB?
    1145 #    print "name=#{@name} @n_attribute_ro=#{@n_attribute_ro}  @n_var_size_is=#{@n_var_size_is} @n_call_port=#{@n_call_port} @n_call_port_omitted_in_CB=#{@n_call_port_omitted_in_CB} @n_entry_port_array_ns=#{@n_entry_port_array_ns}\n"
    1146     return $rom &&
    1147       (@n_attribute_ro > 0 ||
    1148        @n_var_size_is > 0 ||
    1149        ( @n_call_port - @n_call_port_omitted_in_CB - (@n_call_port_dynamic-@n_call_port_array_dynamic) ) > 0 ||
    1150        $ram_initializer && @n_call_port_dynamic ||
    1151        @n_entry_port_array_ns > 0)
    1152 #    return $rom && (@n_attribute_ro > 0 || ( @n_call_port - @n_call_port_omitted_in_CB ) > 0)
     1173
     1174    result = $rom &&
     1175             (@n_attribute_ro > 0 ||
     1176              @n_var_size_is > 0 ||
     1177              ( @n_call_port - @n_call_port_omitted_in_CB - (@n_call_port_dynamic-@n_call_port_array_dynamic) ) > 0 ||
     1178              $ram_initializer && @n_call_port_dynamic > 0 ||
     1179              @n_entry_port_array_ns > 0)
     1180    # print "name=#{@name} n_attribute_ro=#{@n_attribute_ro}  n_var_size_is=#{@n_var_size_is} n_call_port=#{@n_call_port} n_call_port_omitted_in_CB=#{@n_call_port_omitted_in_CB} n_call_port_dynamic=#{@n_call_port_dynamic} n_call_port_array_dynamic=#{@n_call_port_array_dynamic} n_entry_port_array_ns=#{@n_entry_port_array_ns} has_INIB?=#{result}\n"
     1181
     1182    return result
    11531183  end
    11541184
     
    12311261  def idx_is_id_act?
    12321262    @idx_is_id_act
     1263  end
     1264
     1265  def multi_domain?
     1266    @b_need_ptab
    12331267  end
    12341268
     
    13531387#                                               逆require ポートに対して複数の結合がないかチェックする
    13541388# @generate:: [ Symbol, String, Plugin ]  = [ PluginName, option, Plugin ] Plugin は生成後に追加される
     1389# @b_post_code_generated:: Bool: true if generated in tmp_plugin_post_code.cdl
    13551390#
    13561391# composite のためインスタンス変数
     
    13751410# @id:: Integer : コード生成直前に設定  (プロトタイプ宣言の場合は -1 のまま放置)
    13761411# @id_specified::Integer : 指定された id
    1377 # @restrict_list::{ entry_name => { func_name, [ region_name, ... ] } }
     1412# @restrict_list::{ entry_name => { func_name, [ region_path_str, ... ] } }
     1413# @restrict_list2::{ entry_name => { func_name, [ domain_root_region, ... ] } }
     1414# @b_restrict_referenced::Bool: restrict_list が参照れた
    13781415
    13791416=begin
     
    14591496    @referenced_port_list = {}
    14601497    @restrict_list = {}
     1498    @restrict_list2 = {}
     1499    @b_restrict_referenced = false
     1500    @b_post_code_generated = false
    14611501
    14621502    @cell_list = {}
     
    18031843      set_specifier_list( Generator.get_statement_specifier )
    18041844    end
     1845    if TECSGEN.post_coded?
     1846      @b_post_code_generated = true
     1847    end
    18051848    set_f_def f_def
    18061849
     
    18201863    if ! @in_composite then
    18211864      # if @celltype.instance_of? Celltype then
     1865      if @celltype then  # composite でも呼びだす, エラー時 nil
    18221866        @celltype.new_cell self
    1823       # end
     1867      end
    18241868      @@cell_list << self
    18251869    end
     
    21322176  end
    21332177
     2178  #=== Cell# composite のセルか?
     2179  def is_of_composite?
     2180    if @celltype.kind_of? CompositeCelltype
     2181      return true
     2182    else
     2183      return false
     2184    end
     2185  end
     2186
     2187  #=== Cell# tmp_plugin_post_code.cdl で生成されたセルか?
     2188  def post_code_generated?
     2189    @b_post_code_generated
     2190  end
     2191
    21342192  # composite cell の port に対応する内部の cell の port の名前(リンク時に必要な名前)
    21352193  def get_real_global_name port_name
     
    22192277
    22202278      # セルタイプ内で port_name の CompositeCelltypeJoin を探す(コード生成段階では必ず見つかる)
     2279      # print "get_real_cell: cell=#{@name} port=#{port_name}\n"
     2280      # pp @cell_list
    22212281      cj = @celltype.find_export( port_name )
    22222282
     
    22302290  end
    22312291
     2292  #=== Cell#get_real_celltype
     2293  #
     2294  def get_real_celltype( port_name )
     2295    if @celltype.instance_of?( CompositeCelltype ) then
     2296      return @celltype.get_real_celltype port_name
     2297    else
     2298      return @celltype
     2299    end
     2300  end
    22322301
    22332302  #=== Cell# 受け口のport の参照カウントをアップする
     
    22702339      return "#{@global_name}_#{port_name}"
    22712340    end
     2341  end
     2342
     2343  #Cell#属性の初期値を得る
     2344  #attr_name::Symbol  必ず初期化されていないと Ruby 例外となる
     2345  def get_attr_initializer attr_name
     2346    val = @join_list.get_item( attr_name )
     2347    if val == nil then
     2348      val = (@celltype.find  attr_name).get_initializer
     2349    else
     2350      val = val.get_rhs
     2351    end
     2352    return val
    22722353  end
    22732354
     
    25202601        else
    25212602          cell = j.get_rhs_cell2
    2522           next if cell == nil     # 右辺が見つからなかった.既にエラー
     2603          next if cell == nil || cell.get_celltype == nil     # 右辺が見つからなかった.既にエラー
    25232604          port = cell.get_celltype.find( j.get_rhs_port2 )
     2605          if port == nil then
     2606            dbgPrint "set_port_ref: #{@name}.#{j.get_name} = #{cell.get_name}.#{j.get_rhs_port2}\n"
     2607            # through プラグインで生成されたセルの受け口が見つからないケース (のハズ)
     2608            cdl_error( "entry '$1' not found in '$2' refered from $3.$4", j.get_rhs_port2, cell.get_name, @name, j.get_name )
     2609            next
     2610          end
    25242611          dbgPrint( "set_port_reference_count: #{@name}.#{j.get_name} => #{cell.get_name}.#{port.get_name}\n")
    25252612          cell.port_referenced port
     
    29663053  #=== Cell#restrict を追加
    29673054  def add_restrict( entry_name, func_name, region_name_list )
    2968     if @restrict_list[ entry_name ] then
    2969       if @restrict_list[ entry_name ][ func_name ] then
    2970         @restrict_list[ entry_name ][ func_name ].each{ |rn|
    2971           if region_name_list.include? rn then
    2972             # p func_name
    2973             name = func_name ? entry_name : entry_name+"."+func_name
    2974             cdl_warning( "W9999 $1 restrict region duplicate $2", name, rn )
     3055    if @restrict_list[ entry_name ] == nil then
     3056      @restrict_list[ entry_name ] = {}
     3057      @restrict_list2[ entry_name ] = {}
     3058    end
     3059    if @restrict_list[ entry_name ][ func_name ] == nil then
     3060      @restrict_list[ entry_name ][ func_name ] = []
     3061      @restrict_list2[ entry_name ][ func_name ] = []
     3062    end
     3063    region_name_list.each { |rp|
     3064      @restrict_list[ entry_name ][ func_name ] << rp
     3065      # p "Class: " + rp.to_s
     3066      obj = Namespace.find rp
     3067      if ( obj.kind_of? Region ) then
     3068        @restrict_list2[ entry_name ][ func_name ] << obj.get_domain_root
     3069      else
     3070        cdl_error( "S9999 $1 not found or not region", rp.to_s )
     3071      end
     3072    }
     3073  end
     3074
     3075  #=== Cell#check_restrict_list
     3076  def check_restrict_list
     3077    # p "check_restrict_list"
     3078    @restrict_list.each{ |entry_name, func_hash|
     3079      func_hash.each{ |func_name, region_list|
     3080        region_list.each{ |rp|
     3081          obj = Namespace.find rp
     3082          if ( obj.kind_of? Region ) then
     3083            if obj.get_domain_root != @region.get_domain_root then
     3084            else
     3085              cdl_info( "I9999 $1: restrict calling domain to $2, which is same domain as the cell locates", @name, rp.to_s )
     3086              # restrict を同じドメインを指定してもよいこととする (HRP3)
     3087              # KernelDoamin 内のセルに対し、KernelDomain に restrict している場合、
     3088              # 無所属経由で結合されているが、KernelDomain から呼出すことを想定した許可
     3089            end
     3090          else
     3091            cdl_error( "S9999 $1 not region", rp.to_s )
     3092          end
     3093        }
     3094      }
     3095    }
     3096  end
     3097
     3098  #=== Cell#callable?
     3099  def callable?( callee_cell, entry_name, func_name )
     3100    # p "callable? #{@name}"
     3101    res = callee_cell.callable_from?( entry_name, func_name, self )
     3102    dbgPrint "callable? #{callee_cell.get_namespace_path}.#{entry_name}.#{func_name} from #{@NamespacePath} is #{res}\n"
     3103    return res
     3104  end
     3105
     3106  #=== Cell#callable_from? (private)
     3107  def callable_from?( entry_name, func_name, caller_cell )
     3108    @b_restrict_referenced = true
     3109    if @restrict_list.length == 0 then
     3110      return true
     3111    end
     3112
     3113    dr = caller_cell.get_region.get_domain_root
     3114    if @restrict_list[entry_name] then
     3115      if @restrict_list[entry_name][func_name] then
     3116        @restrict_list2[entry_name][func_name].each{ |region|
     3117          if dr == region then
     3118            return true
     3119          end
     3120        }
     3121      elsif @restrict_list[entry_name][nil] then
     3122        @restrict_list2[entry_name][nil].each{ |region|
     3123          if dr == region then
     3124            return true
    29753125          end
    29763126        }
    29773127      else
    2978         @restrict_list[ entry_name ][ func_name ] = region_name_list
    2979       end
    2980     else
    2981       func_list = { }
    2982       func_list[ func_name ] = region_name_list
    2983       @restrict_list[ entry_name ] = func_list
    2984     end
    2985     # pp @restrict_list
    2986   end
    2987 
    2988   #=== Cell#check_restrict_list
    2989   def check_restrict_list
    2990     @restrict_list.each{ |entry_name, func_hash|
    2991       func_hash.each{ |func_name, region_list|
    2992         region_list.each{ |rn|
    2993           obj = Namespace.find [ rn ]
    2994           if ( obj.kind_of? Region ) then
    2995             if obj.get_domain_root != @region.get_domain_root then
    2996             else
    2997               cdl_warning( "W9999 $1 in same domain", rn )
    2998             end
    2999           else
    3000             cdl_error( "S9999 $1 not region", region )
    3001           end
    3002         }
    3003       }
    3004     }
    3005   end
    3006 
    3007   #=== Cell#callable?
    3008   def callable?( callee_cell, entry_name, func_name )
    3009     res = callee_cell.callable_from?( entry_name, func_name, self )
    3010     dbgPrint "callable? #{callee_cell.get_namespace_path}.#{entry_name}.#{func_name} from #{@NamespacePath} is #{res}\n"
    3011     return res
    3012   end
    3013 
    3014   #=== Cell#callable_from? (private)
    3015   def callable_from?( entry_name, func_name, caller_cell )
    3016     if @restrict_list.length == 0 then
     3128        return false
     3129      end
     3130    else
     3131      return false
     3132    end
     3133  end
     3134
     3135  #=== Cell#get_callable_regions( entry_name, func_name )
     3136  # func_name=nil の場合、entry_name の可否をチェック数る
     3137  # nil が返る場合、制限されていないことを意味する
     3138  def get_restricted_regions( entry_name, func_name )
     3139    # p "get_restricted_regions #{@name}"
     3140    @b_restrict_referenced = true
     3141    if @restrict_list[entry_name] then
     3142      if @restrict_list[entry_name][func_name] then
     3143        return @restrict_list2[entry_name][func_name]
     3144      else
     3145        return @restrict_list2[entry_name][nil]
     3146      end
     3147    end
     3148    return nil
     3149  end
     3150
     3151  #=== Cell#has_ineffective_restrict_specifier
     3152  # restrict 指定子が指定されていて、参照されていない場合 true
     3153  # 参照は、HRPSVCPlugin のみ
     3154  def has_ineffective_restrict_specifier
     3155    if @restrict_list.length != 0 && @b_restrict_referenced == false then
    30173156      return true
    3018     end
    3019 
    3020     if @restrict_list[entry_name] then
    3021       if @restrict_list[entry_name][nil] &&
    3022          @restrict_list[entry_name][nil].include?( caller_cell.get_region.get_domain_root.get_name )then
    3023         return true
    3024       end
    3025       if @restrict_list[entry_name][func_name] &&
    3026          @restrict_list[entry_name][func_name].include?( caller_cell.get_region.get_domain_root.get_name )then
    3027         return true
    3028       else
    3029         return false
    3030       end
    3031     else
    3032       return true
    3033     end
    3034   end
    3035  
     3157    else
     3158      return false
     3159    end
     3160  end
     3161
    30363162  def show_tree( indent )
    30373163    indent.times { print "  " }
     
    37093835  end
    37103836
     3837  def get_global_name
     3838    @global_name
     3839  end
     3840
    37113841  def get_port_list
    37123842    @port_list
     
    37233853  def get_internal_allocator_list
    37243854    @internal_allocator_list
     3855  end
     3856
     3857  #== CompositeCelltype#get_real_celltype
     3858  # port_name に接続されている内部のセルタイプを得る
     3859  def get_real_celltype( port_name )
     3860    cj = find_export port_name
     3861    inner_celltype = cj.get_cell.get_celltype
     3862    if inner_celltype.instance_of? CompositeCelltype then
     3863      return inner_celltype.get_real_celltype
     3864    else
     3865      return inner_celltype
     3866    end
    37253867  end
    37263868
     
    39364078    else
    39374079      # entry port optimize
    3938       if $unopt then
     4080      if $unopt || $unopt_entry then
    39394081        # 最適化なし
    39404082        @b_VMT_useless = false                     # VMT 不要 (true の時 VMT を介することなく呼出す)
     
    42604402
    42614403  def is_VMT_useless?                     # VMT 関数テーブルを使用しない
    4262    @b_VMT_useless
     4404    if @port_type == :ENTRY && $unopt_entry == true then
     4405      # プラグインから $unopt_entry を設定するケースのため
     4406      # ここで読み出すときに、false を返す (reset_optimize での設定変更は速すぎる)
     4407      return false
     4408    else
     4409      return @b_VMT_useless
     4410    end
    42634411  end
    42644412
    42654413  def is_skelton_useless?                 # スケルトン関数不要   (true の時、受け口関数を呼出す)
    4266     @b_skelton_useless
     4414    if @port_type == :ENTRY && $unopt_entry == true then
     4415      # プラグインから $unopt_entry を設定するケースのため
     4416      # ここで読み出すときに、false を返す (reset_optimize での設定変更は速すぎる)
     4417      return false
     4418    else
     4419      return @b_skelton_useless
     4420    end
    42674421  end
    42684422
     
    48014955      if ! c.get_f_def then   # Namespace の @cell_list にはプロトタイプが含まれるケースあり
    48024956        if c.get_f_ref then
    4803           cdl_error( "S1093 $1 : undefined cell" , c.get_namespace_path.get_path_str )
     4957          c.cdl_error( "S1093 $1 : undefined cell" , c.get_namespace_path.get_path_str )
    48044958        elsif $verbose then
    4805           cdl_warning( "W1006 $1 : only prototype, unused and undefined cell" , c.get_namespace_path.get_path_str )
     4959          c.cdl_warning( "W1006 $1 : only prototype, unused and undefined cell" , c.get_namespace_path.get_path_str )
    48064960        end
    48074961      else
     
    48104964        # if c.get_f_ref == false && c.is_generate? && ct && ct.is_inactive? then
    48114965        if c.get_f_ref == false && ct && ct.is_inactive? then
    4812           cdl_warning( "W1007 $1 : non-active cell has no entry join and no factory" , c.get_namespace_path.get_path_str )
     4966          c.cdl_warning( "W1007 $1 : non-active cell has no entry join and no factory" , c.get_namespace_path.get_path_str )
     4967        end
     4968        if c.has_ineffective_restrict_specifier then
     4969          c.cdl_warning( "W9999: $1 has ineffective restrict specifier", c.get_namespace_path.get_path_str )
    48134970        end
    48144971      end
     
    50055162  end
    50065163
     5164  #== Namespace (Region) に属するセルのリスト
     5165  def get_cell_list
     5166    @cell_list
     5167  end
     5168
     5169  #== Namespace (Region)# 子リージョンのリスト
     5170  #
     5171  # リージョンは Namespace クラスで namespace として記憶されている
     5172  def get_region_list
     5173    @namespace_list
     5174  end
     5175 
    50075176  def show_tree( indent )
    50085177    indent.times { print "  " }
     
    56015770          next_cell_nsp       = @through_generated_list[ i + 1 ].get_cell_namespace_path
    56025771          next_port_name      = @through_generated_list[ i + 1 ].get_through_entry_port_name
     5772          next_port_subscript = @through_generated_list[ i + 1 ].get_through_entry_port_subscript
    56035773        rescue Exception => evar
    56045774          cdl_error( "S1124 $1: plugin function failed: \'get_through_entry_port_name\'" , plugin_name )
     
    56195789        next_cell      = @cell
    56205790        next_port_name = @port_name
     5791        next_port_subscript = @rhs_subscript
    56215792
    56225793        if next_cell == nil then
     
    56305801        # region から @cell_name.@port_name への through がないか探す
    56315802        # rp = @through_list[i][3].find_cell_port_through_plugin( @cell_name, @port_name ) #762
    5632         rp = @through_list[i][3].find_cell_port_through_plugin( @cell.get_global_name, @port_name )
     5803        rp = @through_list[i][3].find_cell_port_through_plugin( @cell.get_global_name, @port_name, @rhs_subscript )
    56335804           # @through_list[i] と @region_through_list[i-cp_len] は同じ
    56345805        # 共用しないようにするには、見つからなかったことにすればよい
     
    56435814        plClass = load_plugin( plugin_name, ThroughPlugin )
    56445815        if( plClass ) then
    5645           gen_through_cell_code_and_parse( plugin_name, i, next_cell, next_port_name, plClass )
     5816          gen_through_cell_code_and_parse( plugin_name, i, next_cell, next_port_name, next_port_subscript, plClass )
    56465817        end
    56475818      else
     
    56565827          # 生成したものを region(@through_list[i][3]) のリストに追加
    56575828          # @through_list[i][3].add_cell_port_through_plugin( @cell_name, @port_name, @through_generated_list[i] ) #762
    5658           @through_list[i][3].add_cell_port_through_plugin( @cell.get_global_name, @port_name, @through_generated_list[i] )
     5829          @through_list[i][3].add_cell_port_through_plugin( @cell.get_global_name, @port_name, @rhs_subscript, @through_generated_list[i] )
    56595830        end
    56605831      end
     
    56905861
    56915862  #=== Join# through プラグインを呼び出して CDL 生成させるとともに、import する
    5692   def gen_through_cell_code_and_parse( plugin_name, i, next_cell, next_port_name, plClass )
     5863  def gen_through_cell_code_and_parse( plugin_name, i, next_cell, next_port_name, next_port_subscript, plClass )
    56935864
    56945865    through = @through_list[ i ]
     
    57175888
    57185889    begin
    5719       plugin_object = plClass.new( "#{generating_cell_name}".to_sym, plugin_arg.to_s, next_cell, "#{next_port_name}".to_sym, @definition.get_signature, @celltype, caller_cell )
     5890      plugin_object = plClass.new( generating_cell_name.to_sym, plugin_arg.to_s,
     5891                                   next_cell, next_port_name.to_sym, next_port_subscript,
     5892                                   @definition.get_signature, @celltype, caller_cell )
    57205893      plugin_object.set_locale @locale
    57215894    rescue Exception => evar
     
    59126085  end
    59136086
    5914   def get_rhs_subscript
     6087  # 末尾数字1 : CDL で指定された、右辺のセルを返す
     6088  def get_rhs_cell1   # get_cell と同じ
     6089    @cell
     6090  end
     6091  def get_rhs_port1   # get_port_name 同じ
     6092    @port_name
     6093  end
     6094  def get_rhs_subscript1
    59156095    @rhs_subscript
    59166096  end
     
    59226102    # through 指定あり?
    59236103    if @through_list[0] then
    5924       # mikan through で生成したものが root namespace 限定
    59256104      # through で生成されたセルを探す
    5926 #      cell = Namespace.find( [ "::", @through_generated_list[0].get_cell_name.to_sym ] )    #1
    59276105      cell = Namespace.find( @through_generated_list[0].get_cell_namespace_path )    #1
    59286106      # cell のプラグインで生成されたポート名のポートを探す (composite なら内部の繋がるポート)
     
    59316109      # ポートを返す(composite なら内部の繋がるポートを返す)
    59326110      return @cell.get_real_port( @port_name )
     6111    end
     6112  end
     6113
     6114  #=== Join# 右辺の配列添数を得る
     6115  #    右辺が through の場合は挿入されたセルの添数
     6116  #    右辺が composite の場合は、内部の繋がるセルのポートの添数 (composite では変わらない)
     6117  #    このメソッドは get_rhs_cell,  と対になっている
     6118  def get_rhs_subscript
     6119    if @through_list[0] then
     6120      return @through_generated_list[0].get_through_entry_port_subscript
     6121    else
     6122      return @rhs_subscript
    59336123    end
    59346124  end
     
    65686758end
    65696759
    6570 #== Domain
     6760#== DomainType
    65716761#
    65726762# region の domain を記憶するクラス
     
    66076797      return if pluginClass == nil
    66086798      @plugin = pluginClass.new( @region, @name, @option )
     6799      @plugin.set_locale @locale
    66096800    end
    66106801  end
     
    66246815  end
    66256816
    6626   #== Domain リージョンの Hash を得る
     6817  #== DomainType リージョンの Hash を得る
    66276818  # @@domain_regions の説明参照
    66286819  def self.get_domain_regions
     
    66366827  def get_option
    66376828    @option
     6829  end
     6830
     6831  #== DomainType#ドメイン種別を得る
     6832  #return::Symbol :kernel, :user, :OutOfDomain
     6833  def get_kind
     6834    @plugin.get_kind
    66386835  end
    66396836
     
    66976894
    66986895    if @@domain_name then
     6896      dbgPrint "Region=#{name} domain_type=#{@@domain_name} option=#{@@domain_option}\n"
    66996897      domain_option = CDLString.remove_dquote @@domain_option.to_s
    67006898      @domain_type = DomainType.new( self, @@domain_name, domain_option )
     
    69457143  end
    69467144
     7145  #== Region# ルートリージョン
     7146  # ルートリージョンは、namespace のルートと同じインスタンス
     7147  def selfget_root
     7148    Namespace.get_root
     7149  end
     7150
    69477151  def next_in_through_count
    69487152    @in_through_count += 1
     
    69787182  #=== Region# through プラグインで、この region から cell_name.port_name へのプラグインオブジェクトを登録
    69797183  # mikan namesppace 対応 (cell_name)
    6980   def add_cell_port_through_plugin( cell_name, port_name, through_plugin_object )
    6981     @cell_port_throug_plugin_list[ "#{cell_name}.#{port_name}" ] = through_plugin_object
    6982   end
    6983 
    6984   def find_cell_port_through_plugin( cell_name, port_name )
    6985     return @cell_port_throug_plugin_list[ "#{cell_name}.#{port_name}" ]
     7184  def add_cell_port_through_plugin( cell_name, port_name, subscript, through_plugin_object )
     7185    if subscript then
     7186      subscript = '[' + subscript.to_s + ']'
     7187    end
     7188    @cell_port_throug_plugin_list[ "#{cell_name}.#{port_name}#{subscript}" ] = through_plugin_object
     7189  end
     7190
     7191  def find_cell_port_through_plugin( cell_name, port_name, subscript )
     7192    if subscript then
     7193      subscript = '[' + subscript.to_s + ']'
     7194    end
     7195    return @cell_port_throug_plugin_list[ "#{cell_name}.#{port_name}#{subscript}" ]
    69867196  end
    69877197
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/ctypes.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    122122      #   TECS には long double を表現する手段がない (double80_t を定義すればよいか?)
    123123#      cdl_warning( "C1003 $1 & $2 incompatible (\'long double\' is not supported.). Treated as $3." , self.class, another.class, self.class )
    124       cdl_warning( "W9999 $1 & $2 incompatible (\'long double\' is not supported.). Treated as $3." , self.get_type_str, another.get_type_str, self.get_type_str )
     124#      cdl_warning( "W9999 $1 & $2 incompatible (\'long double\' is not supported.). Treated as $3." , self.get_type_str, another.get_type_str, self.get_type_str )
     125      self.to_long     
    125126      return self
    126127    else
     
    185186  end
    186187
     188  def to_long
     189    if @bit_size != -64 then
     190      cdl_warning( "W9999 long specified for $1" , get_type_str )
     191    else
     192      @bit_size = -128  # @bit_size = -128 : long double
     193    end
     194  end
    187195end
    188196
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/expression.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/generate.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2017 by TOPPERS Project
     6#   Copyright (C) 2008-2019 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    122122
    123123class Namespace
     124  @@domain_gen_factory_list = nil
    124125  def generate
    125126
     
    135136          return
    136137        end
     138        if instance_of? Region then
     139          @@domain_gen_factory_list = {}   # create hash
     140        end
    137141      end
    138142
     
    141145      gen_global_header
    142146
     147      if ( instance_of? Region ) && get_domain_type != nil then
     148        # p "*******************  domain_type: #{get_domain_type.get_name}  ****************"
     149        domain_type = get_domain_type
     150        if @@domain_gen_factory_list[ domain_type ] == nil then
     151          @@domain_gen_factory_list[ domain_type ] = self
     152          domain_type.gen_factory
     153        end
     154      end
     155     
    143156      # signature のコードを生成
    144157      @signature_list.each { |s|
     
    455468      }
    456469    end
    457         f.print "       rm -f $(CELLTYPE_COBJS) $(TECSGEN_COBJS) $(PLUGIN_COBJS) $(OTHER_OBJS) $(TARGET) #{timestamp}\n"
     470          f.print "     rm -f $(CELLTYPE_COBJS) $(TECSGEN_COBJS) $(PLUGIN_COBJS) $(OTHER_OBJS) $(TARGET) #{timestamp}\n"
    458471    if $generating_region == @@root_namespace then
    459472      f.print " rm -rf $(GEN_DIR)\n"
     
    465478      f.print "tecs : $(PRE_TECSGEN_TARGET) $(TIMESTAMP) $(POST_TECSGEN_TARGET)\n\n"
    466479      f.print "$(TIMESTAMP) : $(TECS_IMPORTS)\n"
    467       f.print " $(TECSGEN) #{TECSGEN.subst_tecspath( $arguments, true )}\n"
     480      f.print " $(TECSGEN) #{TECSGEN.subst_tecspath( $arguments, true )}\n\n"
    468481      # f.print "       touch $(TIMESTAMP)\n\n"
    469 
    470482    else
    471483      f.print "tecs:\n"
     
    473485    end
    474486
     487    # tecsflow:, tcflow ターゲット
     488    if $generating_region.get_n_cells != 0 || $generating_region == @@root_namespace then
     489      f.print "#####  TECSFlow targets  #####\n"
     490    end
     491
     492    if Region.get_link_roots.length > 1 && $generating_region == @@root_namespace then
     493      tecsflow_target = "tecsflow_sub"
     494      if $generating_region.get_n_cells > 0 then
     495        f.print "tecsflow: tecs tecsflow_sub\n"
     496      else
     497        f.print "tecsflow:\n"
     498      end
     499      Region.get_link_roots.each {|region|
     500        if region.get_n_cells > 0 then
     501          f.print "\tcd #{region.get_global_name}; make tecsflow\n"
     502        end
     503      }
     504      f.print "\n"
     505    else
     506      tecsflow_target = "tecsflow"
     507    end
     508
     509    if $generating_region.get_n_cells != 0 then
     510      f.print "#{tecsflow_target} : $(GEN_DIR)/tecsgen.rbdmp tcflow\n"
     511      f.print "\ttecsflow -g $(GEN_DIR)\n\n"
     512      f.print "tecsflow_u : $(GEN_DIR)/tecsgen.rbdmp tcflow\n"
     513      f.print "\ttecsflow -g $(GEN_DIR) -U\n\n"
     514      f.print "$(GEN_DIR)/tecsgen.rbdmp : tecs\n\n"
     515      f.print "tcflow : tecs\n"
     516      f.print "\tmake tcflow_exec\n\n"
     517      f.print "tcflow_exec : $(GEN_DIR)/tcflow.rbdmp\n"
     518      f.print "$(GEN_DIR)/tcflow.rbdmp : $(CELLTYPE_SRCS) $(PLUGIN_CELLTYPE_SRCS)\n"
     519      f.print "\ttcflow -g $(GEN_DIR) -c '$(CC) -E -DTECSFLOW -DTECSGEN $(CFLAGS) -I ./' $^\n"
     520    end
     521
     522    if $generating_region.get_n_cells != 0 || $generating_region == @@root_namespace then
     523      f.print "#####  end TECSFlow targets  #####\n\n"
     524    end
     525
     526    # generic %.o : %.c
    475527    f.print "# generic target for objs\n"
    476528    f.print "$(_TECS_OBJ_DIR)%.o : %.#{$c_suffix}\n"
     
    492544    ### Makefile.tecsgen の生成
    493545    f = AppFile.open( "#{$gen}/Makefile.tecsgen" )
     546
     547    f.print <<EOT
     548# generated automatically by tecsgen.
     549# This file is not intended to modify.
     550#
     551# Makefile variables below are defined.
     552#  TECS_IMPORT_CDLS          .cdl files improted by import statement
     553#  SIGNATURE_HEADERS         .h files of signature
     554#  CELLTYPE_TECSGEN_HEADERS  .h files of celltype
     555#  CELLTYPE_FACTORY_HEADERS  .h files of celltype's factory
     556#  TECS_HEADERS              summary of .h files above
     557#  TECS_INLINE_HEADERS       .h files of celltype inline header
     558#  PLUGIN_INLINE_HEADERS     .h files of plugin generated inline header
     559#
     560#  TECS_COBJS                .o files of TECS
     561#                            = $(TECSGEN_COBJS)+$(PLUGIN_COBJS)+$(CELLTYPE_COBJS)
     562#                            = $(TECS_KERNEL_COBJS)+$(TECS_KERNEL_COBJS)+$(TECS_OUTOFDOMAIN_COBJS)
     563#                            = $(TECSGEN_domain_COBJS)+$(PLUGIN_domain_COBJS)+$(CELLTYPE_domain_COBJS) for each domain
     564#
     565#  TECSGEN_COBJS             .o files of celltype_tecsgen.c
     566#  CELLTYPE_COBJS            .o files of celltype.c (celltype code)
     567#  PLUGIN_COBJS              .o files of plugin generated .c files
     568#
     569#  TECSGEN_SRCS              .c files of celltype_tecsgen.c
     570#  CELLTYPE_SRCS             .c files of celltype.c (celltype code)
     571#  PLUGIN_SRCS               .c files of plugin generated
     572#  PLUGIN_CELLTYPE_SRCS      .c files of plugin generated celltype.c (celltype code)
     573#  PLUGIN_TECSGEN_SRCS       .c files of plugin generated celltype_tecsgen.c
     574#
     575# Variables for domain
     576#  TECS_DOMAINS             domain names
     577#  TECS_KERNEL_COBJS        .o files of kernel domain (tecsgen, celltype, plugin)
     578#  TECS_USER_COBJS          .o files of user domain (tecsgen, celltype, plugin)
     579#  TECS_OUTOFDOMAIN_COBJS   .o files of OutOfDomain (tecsgen, celltype, plugin)
     580#  TECSGEN_domain_COBJS     .o files of celltype_tecsgen.c files for each domain
     581#  PLUGIN_domain_COBJS      .o files of plugin generated .c files for each domain
     582#  CELLTYPE_domain_COBJS    .o files of celltype.c files for each domain
     583#  TECSGEN_domain_SRCS      .c files of celltype_domain_tecsgen.c
     584#  PLUGIN_domain_SRCS       .c files of plugin generated .c files for each domain
     585#  CELLTYPE_domain_SRCS     .c files of celltype.c files for each domain
     586
     587EOT
    494588
    495589    f.print( "TECS_IMPORT_CDLS =" )
     
    546640    DomainType.get_domain_regions.each{ |dt, regions|
    547641      # domain_type は一つのノードには、一つしかないので、このループは、必ず一回しか回らない
     642        ###   mikan 複数のノードがあり、異なる domain_type が指定される可能性はある
    548643      domain_regions = regions
    549644      domain_type = dt
     
    588683      f.print( "\n\n" )
    589684
    590       f.print( "# TECS_COBJS: objects from sources which are automatically generated by tecsgen\n" )
     685      f.print( "# TECS_KERNEL_COBJS: objects belong to kernel domain\n" )
     686      f.print( "TECS_KERNEL_COBJS = \\\n" )
     687      domain_regions.each{ |r|
     688        if r.get_domain_type.get_kind == :kernel then
     689          f.print( "    $(TECSGEN#{decideDomainNameProc.call r}_COBJS) \\\n" )
     690          f.print( "    $(PLUGIN#{decideDomainNameProc.call r}_COBJS) \\\n" )
     691          f.print( "    $(CELLTYPE#{decideDomainNameProc.call r}_COBJS) \\\n" )
     692        end
     693      }
     694      f.print( "# TECS_KERNEL_COBJS terminator\n\n" )
     695
     696      f.print( "# TECS_USER_COBJS: objects belong to user domain\n" )
     697      f.print( "TECS_USER_COBJS = \\\n" )
     698      domain_regions.each{ |r|
     699        if r.get_domain_type.get_kind == :user then
     700          f.print( "    $(TECSGEN#{decideDomainNameProc.call r}_COBJS) \\\n" )
     701          f.print( "    $(PLUGIN#{decideDomainNameProc.call r}_COBJS) \\\n" )
     702          f.print( "    $(CELLTYPE#{decideDomainNameProc.call r}_COBJS) \\\n" )
     703        end
     704      }
     705      f.print( "# TECS_USER_COBJS terminator\n\n" )
     706
     707      f.print( "# TECS_OUTOFDOMAIN_COBJS: objects belong to OutOfDomain\n" )
     708      f.print( "TECS_OUTOFDOMAIN_COBJS = \\\n" )
     709      domain_regions.each{ |r|
     710        if r.get_domain_type.get_kind == :OutOfDomain then
     711          f.print( "    $(TECSGEN#{decideDomainNameProc.call r}_COBJS) \\\n" )
     712          f.print( "    $(PLUGIN#{decideDomainNameProc.call r}_COBJS) \\\n" )
     713          f.print( "    $(CELLTYPE#{decideDomainNameProc.call r}_COBJS) \\\n" )
     714        end
     715      }
     716      f.print( "# TECS_OUTOFDOMAIN_COBJS terminator\n\n" )
     717     
     718      f.print( "# TECSGEN_COBJS: objects from sources which are automatically generated by tecsgen\n" )
    591719      f.print( "TECSGEN_COBJS = \\\n" )
    592720      domain_regions.each{ |r|
     
    622750
    623751    ###
    624     f.print( "# TECS_COBJS: objects from sources which are automatically generated by tecsgen\n" )
     752    f.print( "# TECSGEN_COBJS: objects from sources which are automatically generated by tecsgen\n" )
    625753    domain_regions.each{ |r|
    626754      nsp = decideDomainNameProc.call( r )
     
    656784
    657785    f.print( "# PLUGIN_SRCS: sources automatically generated by plugin\n" )
     786    f.print( "PLUGIN_CELLTYPE_SRCS = \\\n" )
    658787    domain_regions.each{ |r|
    659788      nsp = decideDomainNameProc.call( r )
    660       f.print( "PLUGIN#{nsp}_SRCS = \\\n" )
    661       gen_celltype_names_domain( f, "   $(GEN_DIR)/", "_tecsgen.#{$c_suffix} \\\n", domain_type, r, true )
    662       gen_celltype_names_domain2( f, "  $(GEN_DIR)/", ".#{$c_suffix} \\\n", domain_type, r, true, false )
    663       f.print( "# PLUGIN#{nsp}_SRCS terminator\n\n" )
    664     }
    665 
     789      f.print( "  $(PLUGIN#{nsp}_CELLTYPE_SRCS)\\\n" )
     790    }
     791    f.print( "# PLUGIN_CELLTYPE_SRCS terminator\n\n" )
     792    f.print( "PLUGIN_TECSGEN_SRCS = \\\n" )
     793    domain_regions.each{ |r|
     794      nsp = decideDomainNameProc.call( r )
     795      f.print( "  $(PLUGIN#{nsp}_TECSGEN_SRCS)\\\n" )
     796    }
     797    f.print( "# PLUGIN_TECSGEN_SRCS terminator\n\n" )
     798    domain_regions.each{ |r|
     799      nsp = decideDomainNameProc.call( r )
     800      f.print( "PLUGIN#{nsp}_SRCS = $(PLUGIN#{nsp}_CELLTYPE_SRCS) $(PLUGIN#{nsp}_TECSGEN_SRCS)\n\n" )
     801      f.print( "PLUGIN#{nsp}_CELLTYPE_SRCS = \\\n" )
     802      gen_celltype_names_domain2( f, "", ".#{$c_suffix} \\\n", domain_type, r, true, false )
     803      f.print( "# PLUGIN#{nsp}_CELLTYPE_SRCS terminator\n\n" )
     804      nsp = decideDomainNameProc.call( r )
     805      f.print( "PLUGIN#{nsp}_TECSGEN_SRCS = \\\n" )
     806      gen_celltype_names_domain( f, "", "_tecsgen.#{$c_suffix} \\\n", domain_type, r, true )
     807      f.print( "# PLUGIN#{nsp}_TECSGEN_SRCS terminator\n\n" )
     808    }
     809
     810    f.print( "# CELLTYPE_SRCS: sources of celltype code written by user\n" )
     811     f.print( "CELLTYPE_SRCS = \\\n" )
     812     gen_celltype_names( f, "   ", ".#{$c_suffix} \\\n", false, false )
     813      f.print( "# CELLTYPE_SRCS terminator\n\n" )
    666814    f.close
    667815
     
    779927    @namespace_list.each{ |ns|
    780928      ns.travers_all_signature_proc proc
     929    }
     930  end
     931
     932  #=== Namespace#すべてのセルタイプをたどる
     933  def travers_all_celltype # ブロック引数 { |celltype|  }
     934    proc = Proc.new    # このメソッドのブロック引数
     935    @celltype_list.each{ |ct|
     936      proc.call ct
     937    }
     938    @namespace_list.each{ |ns|
     939      ns.travers_all_celltype_proc proc
     940    }
     941  end
     942  def travers_all_celltype_proc proc
     943    @celltype_list.each{ |ct|
     944      proc.call ct
     945    }
     946    @namespace_list.each{ |ns|
     947      ns.travers_all_celltype_proc proc
    781948    }
    782949  end
     
    10231190    gen_ph_get_cellcb f
    10241191    gen_ph_attr_access f          if @n_attribute_rw > 0 || @n_attribute_ro > 0 || @n_var > 0
    1025     gen_ph_cp_fun_macro f         if @n_call_port > 0
     1192    f.print "#ifndef TECSFLOW\n"
     1193    gen_ph_cp_fun_macro f, false  if @n_call_port > 0
     1194    f.print "#else  /* TECSFLOW */\n"
     1195    gen_ph_cp_fun_macro f, true   if @n_call_port > 0
     1196    f.print "#endif /* TECSFLOW */\n"
    10261197#    gen_ph_abstract_ep_des_type f
    10271198
     
    12471418  def gen_ph_info f
    12481419
     1420    yn_multi_domain = "no"
     1421    yn_multi_domain = "yes" if multi_domain?
    12491422    yn_idx_is_id = "no"
    12501423    yn_idx_is_id = "yes"  if @idx_is_id
     
    12551428    yn_rom       = "no"
    12561429    yn_rom       = "yes"  if $rom
     1430    yn_has_CB    = "no"
     1431    yn_has_CB    = "yes"  if has_CB?
     1432    yn_has_INIB  = "no"
     1433    yn_has_INIB  = "yes"  if has_INIB?
    12571434    yn_cb_init   = "no"
    12581435    yn_cb_init   = "yes"  if need_CB_initializer?
     
    12631440 * celltype          :  #{@name}
    12641441 * global name       :  #{@global_name}
     1442 * multi-domain      :  #{yn_multi_domain}
    12651443 * idx_is_id(actual) :  #{yn_idx_is_id}(#{yn_idx_is_id_act})
    12661444 * singleton         :  #{yn_singleton}
    1267  * has_CB            :  #{has_CB?}
    1268  * has_INIB          :  #{has_INIB?}
     1445 * has_CB            :  #{yn_has_CB}
     1446 * has_INIB          :  #{yn_has_INIB}
    12691447 * rom               :  #{yn_rom}
    12701448 * CB initializer    :  #{yn_cb_init}
     
    15951773      f.print( "#define #{@global_name}_GET_CELLCB(idx) ((void *)0)\n" )
    15961774    elsif @idx_is_id_act then   # mikan 単一のセルの場合の最適化, idx_is_id でない場合
    1597       f.print( "#define #{@global_name}_GET_CELLCB(idx) (#{@global_name}_CB_tab[(idx) - #{@global_name}_ID_BASE])\n" )
     1775      f.print( "#define #{@global_name}_GET_CELLCB(idx) (#{@global_name}_CB_ptab[(idx) - #{@global_name}_ID_BASE])\n" )
    15981776    else
    15991777      f.print( "#define #{@global_name}_GET_CELLCB(idx) (idx)\n" )
     
    17991977  end
    18001978
    1801   def gen_ph_cp_fun_macro f
    1802     if @n_call_port >0 then
     1979  def gen_ph_cp_fun_macro f, b_flow
     1980    if @n_call_port >0 && b_flow == false then
    18031981      f.printf( TECSMsg.get( :CPM_comment ) , "#_CPM_#" )
    18041982    end
     
    18562034
    18572035        # 関数名の出力(標準:受け口ディスクリプタから VMT の関数名、最適化:受け口関数 or 受け口ディスクリプタ)
    1858         if ! p.is_VMT_useless? then
     2036        if b_flow then
     2037          f.print( "\t  (p_that)->#{p.get_name}#{subsc}.#{fun.get_name}__T( \\\n" )
     2038        elsif ! p.is_VMT_useless? then
    18592039          # 標準コード
    18602040          if @singleton then
     
    18912071
    18922072        # 受け口情報の出力(標準:受け口ディスクリプタ、最適化:IDX など)
    1893         if ! p.is_skelton_useless? && ! p.is_cell_unique? then
     2073        if b_flow then
     2074        elsif ! p.is_skelton_useless? && ! p.is_cell_unique? then
    18942075          # 標準コード
    18952076          if @singleton then
     
    19692150        p_cellcb = "    #{@global_name}_CB *p_cellcb = p_that;\n"
    19702151        delim = ", "
    1971         cb = "p_that#{inib}->"
     2152        cb = "p_cellcb#{inib}->"
    19722153      end
    19732154
     
    26162797        f.print "extern  #{@global_name}_INIB  #{@global_name}_SINGLE_CELL_INIB;\n"
    26172798      end
    2618 
    2619 #     @ordered_cell_list.each{ |c|
    2620 #        f.print "extern  #{@global_name}_CB  #{@global_name}_#{c.get_name}_CB;\n"
    2621 #      }
    2622 
    26232799      f.print "\n"
    2624     elsif @idx_is_id_act then
    2625       f.print "extern #{@global_name}_CB  *#{@global_name}_CB_tab[];\n"
     2800    elsif @b_need_ptab then
     2801      f.printf( TECSMsg.get( :SCP_comment ),  "#_MCPP_#" )
     2802      if has_CB? then
     2803        f.print "extern #{@global_name}_CB  *const #{@global_name}_CB_ptab[];\n"
     2804        @ordered_cell_list.each{ |c|
     2805          if c.is_generate? then                           # 生成対象か?
     2806            name_array = get_name_array c
     2807            f.print "extern #{@global_name}_CB  #{name_array[4]};\n"
     2808          end
     2809        }
     2810      elsif has_INIB?
     2811        f.print "extern #{@global_name}_INIB  *const #{@global_name}_INIB_ptab[];\n"
     2812        @ordered_cell_list.each{ |c|
     2813          if c.is_generate? then                           # 生成対象か?
     2814            name_array = get_name_array c
     2815            f.print "extern #{@global_name}_INIB  #{name_array[11]};\n"
     2816          end
     2817        }
     2818      end
    26262819    else
    2627       f.print "extern #{@global_name}_CB  #{@global_name}_CB_tab[];\n"
     2820      f.printf( TECSMsg.get( :SCP_comment ),  "#_MCPB_#" )
     2821      if has_CB? then
     2822        f.print "extern #{@global_name}_CB  #{@global_name}_CB_tab[];\n"
     2823      elsif has_INIB?
     2824        f.print "extern #{@global_name}_INIB  #{@global_name}_INIB_tab[];\n"
     2825      end
    26282826    end
    26292827  end
    26302828
    26312829  def gen_ph_INIB_as_CB f
    2632 
     2830    # ここは、手抜きである。本来なら INIB を出力すべき
    26332831    if ! has_CB? && has_INIB? then
    26342832      f.printf( TECSMsg.get( :DCI_comment ),  "#_DCI_#" )
    2635       f.print "#define #{@global_name}_CB_tab           #{@global_name}_INIB_tab\n"
    2636       f.print "#define #{@global_name}_SINGLE_CELL_CB   #{@global_name}_SINGLE_CELL_INIB\n"
     2833      if @singleton then
     2834        f.print "#define #{@global_name}_SINGLE_CELL_CB   #{@global_name}_SINGLE_CELL_INIB\n"
     2835      elsif @b_need_ptab then
     2836        f.print "#define #{@global_name}_CB_ptab           #{@global_name}_INIB_ptab\n"
     2837      else
     2838        f.print "#define #{@global_name}_CB_tab           #{@global_name}_INIB_tab\n"
     2839      end
    26372840      f.print "#define #{@global_name}_CB               #{@global_name}_INIB\n"
    26382841      f.print "#define tag_#{@global_name}_CB           tag_#{@global_name}_INIB\n"
     
    26582861      f.printf( TECSMsg.get( :FEC_comment ), "#_FEC_#" )
    26592862
    2660       if @idx_is_id_act then
     2863      if @b_need_ptab then
    26612864        amp = ''
     2865        tab = 'ptab'
    26622866      else
    26632867        amp = '&'
     2868        tab = 'tab'
    26642869      end
    26652870      f.print <<EOT
    26662871#define FOREACH_CELL(i,p_cb)   \\
    26672872    for( (i) = 0; (i) < #{@global_name}_N_CELL; (i)++ ){ \\
    2668        #{necessity}(p_cb) = #{amp}#{@global_name}_CB_tab[i];
     2873       #{necessity}(p_cb) = #{amp}#{@global_name}_CB_#{tab}[i];
    26692874
    26702875#define END_FOREACH_CELL   }
     
    27993004        if @singleton then
    28003005          f.print "\t#{that}_inib = &#{@global_name}_SINGLE_CELL_INIB;\n\n"
    2801         elsif @idx_is_id_act
    2802           f.print "\t#{that}_inib = #{@global_name}_INIB_tab[(i)];\n\n"
     3006        elsif @b_need_ptab then
     3007          f.print "\t#{that}_inib = #{@global_name}_INIB_ptab[(i)];\n\n"
    28033008        else
    28043009          f.print "\t#{that}_inib = &#{@global_name}_INIB_tab[(i)];\n\n"
     
    33973602        fs.each{ |r, f| f.print "#{@global_name}_INIB #{@global_name}_SINGLE_CELL_INIB = \n" }
    33983603        indent = 0
    3399       elsif ! @idx_is_id_act then
     3604      elsif ! @b_need_ptab then
    34003605        fs.each{ |r, f| f.print "#{@global_name}_INIB #{@global_name}_INIB_tab[] = {\n" }
    34013606        indent = 1
     
    34183623
    34193624        print_indent( f, indent )
    3420         if @idx_is_id_act then
     3625        if @b_need_ptab then
    34213626          f.print "const #{@global_name}_INIB #{name_array[5]} = "
    34223627        end
     
    34283633        unless @singleton then
    34293634          # 1 つの cell INIB の終わり
    3430           if @idx_is_id_act then
     3635          if @b_need_ptab then
    34313636            f.print( "};\n\n" )
    34323637          else
     
    34353640        end
    34363641      }
    3437       if ! @idx_is_id_act then
     3642      if ! @b_need_ptab then
    34383643        fs.each{ |r, f| f.print( "};\n\n" ) }
    34393644      end
     
    34503655          fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_SINGLE_CELL_CB = \n" }
    34513656          indent = 0
    3452         elsif ! @idx_is_id_act then
     3657        elsif ! @b_need_ptab then
    34533658          fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_CB_tab[] = {\n" }
    34543659          indent = 1
     
    34713676
    34723677          print_indent( f, indent )
    3473           if @idx_is_id_act then
     3678          if @b_need_ptab then
    34743679            f.print "#{@global_name}_CB #{name_array[2]} = "
    34753680          end
     
    34933698          unless @singleton then
    34943699            # 1 つの cell CB の終わり
    3495             if @idx_is_id_act then
     3700            if @b_need_ptab then
    34963701              f.print( "};\n\n" )
    34973702            else
     
    35003705          end
    35013706        }
    3502         if ! @idx_is_id_act then
     3707        if ! @b_need_ptab then
    35033708          fs.each{ |r, f| f.print( "};\n\n" ) }
    35043709        end
     
    35073712          fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_SINGLE_CELL_CB;\n" }
    35083713          indent = 0
    3509         elsif @idx_is_id_act then
     3714        elsif @b_need_ptab then
    35103715          @ordered_cell_list.each{ |c|
    35113716            next if ! c.is_generate?
     
    35263731  def gen_cell_cb_tab f
    35273732    indent = 0
    3528     if @idx_is_id_act then
     3733    if @b_need_ptab then
    35293734      if has_INIB? && ( $ram_initializer || ! has_CB? ) then
    35303735        f.print "/* ID to INIB table #_INTAB_# */\n"
     
    35373742        }
    35383743
    3539         f.print "#{@global_name}_INIB *#{@global_name}_INIB_tab[] ={\n"
     3744        f.print "#{@global_name}_INIB *const #{@global_name}_INIB_ptab[] ={\n"
    35403745        @ordered_cell_list.each{ |c|
    35413746          if c.is_generate? then                           # 生成対象か?
     
    35573762        }
    35583763
    3559         f.print "#{@global_name}_CB *#{@global_name}_CB_tab[] ={\n"
     3764        f.print "#{@global_name}_CB *const #{@global_name}_CB_ptab[] ={\n"
    35603765        @ordered_cell_list.each{ |c|
    35613766          if c.is_generate? then                           # 生成対象か?
     
    35863791  #   name_array[9] = @global_name    # celltype global name
    35873792  #   name_array[10] = cell.get_global_name # cell global name
     3793  #   name_array[11] = cell_INIB_proto #INIB name for proto type
    35883794 
    35893795  def get_name_array( cell )
     
    35943800      cell_CB_proto = "#{@global_name}_SINGLE_CELL_CB"
    35953801      cell_INIB_name = "#{@global_name}_SINGLE_CELL_INIB"
     3802      cell_INIB_proto = cell_INIB_name
    35963803      cell_ID = 0
    35973804    else
    3598       if ! @idx_is_id_act then
     3805      if ! @b_need_ptab then
    35993806        index = cell.get_id - cell.get_celltype.get_id_base
    36003807        cell_CB_name = "#{@global_name}_CB_tab[#{index}]"
     
    36023809        cell_CB_proto = "#{@global_name}_CB_tab[]"
    36033810        cell_INIB_name = "#{@global_name}_INIB_tab[#{index}]"
     3811        cell_INIB_proto = "#{@global_name}_INIB_tab[]"
    36043812      else
    36053813        cell_CB_name = "#{cell.get_global_name}_CB"
     
    36073815        cell_CB_proto = cell_CB_name
    36083816        cell_INIB_name = "#{cell.get_global_name}_INIB"
     3817        cell_INIB_proto = cell_INIB_name
    36093818      end
    36103819      cell_ID = cell.get_id
    3611     end
    3612     if @idx_is_id_act then
    3613       cell_IDX = cell_ID
    3614     else
    3615       cell_IDX = "&#{cell_CB_name}"
    36163820    end
    36173821
     
    36223826    else
    36233827      cell_CBP = "NULL"    # CB も INIB もなければ NULL に置換
     3828    end
     3829
     3830    if @idx_is_id_act then
     3831      cell_IDX = cell_ID
     3832    else
     3833      cell_IDX = cell_CBP
    36243834    end
    36253835
     
    36363846    name_array[9] = @global_name    # celltype global name
    36373847    name_array[10] = cell.get_global_name # cell global name
     3848    name_array[11] = cell_INIB_proto # INIB name for prototype
    36383849
    36393850    return name_array
     
    38204031              c = j.get_rhs_cell                    # 呼び先セル
    38214032              ct = c.get_celltype                   # 呼び先セルタイプ
     4033              name_array = ct.get_name_array( c )   # 呼び先セルタイプで name_array を得る
    38224034              if ct.has_INIB? || ct.has_CB? then
    3823                 name_array = ct.get_name_array( c )   # 呼び先セルタイプで name_array を得る
    38244035                f.printf( "%-40s /* %s #_CCP2_# */\n", "#{name_array[7]},", p.get_name )
    38254036              else
     
    41074318      f = fs[ c.get_region.get_domain_root ]
    41084319
    4109       ct = c.get_celltype
     4320      ct = c.get_celltype     # ct = self でも同じ
    41104321      jl = c.get_join_list
     4322      name_array = get_name_array( c )
    41114323
    41124324      port = ct.get_port_list
     
    41434355              else
    41444356                if has_CB? then
    4145                   if @singleton then
    4146                     f.print "    &#{@global_name}_SINGLE_CELL_CB,        /* CB */\n"
    4147                   else
    4148                     # f.print "    &#{@global_name}_#{c.get_name}_CB,\n"
    4149                     f.print "    &#{@global_name}_CB_tab[#{index}],      /* CB */\n"
    4150                   end
     4357                  # if @singleton then
     4358                  #   f.print "    &#{@global_name}_SINGLE_CELL_CB,        /* CB 1 */\n"
     4359                  # else
     4360                  #   # f.print "    &#{@global_name}_#{c.get_name}_CB,\n"
     4361                  #   f.print "    &#{@global_name}_CB_tab[#{index}],      /* CB 2 */\n"
     4362                  # end
     4363                  f.print "    #{name_array[8]},      /* CB 1 */\n"
    41514364                elsif has_INIB? then
    4152                   if @singleton then
    4153                     f.print "    &#{@global_name}_SINGLE_CELL_INIB,      /* INIB */\n"
    4154                   else
    4155                     f.print "    &#{@global_name}_INIB_tab[#{index}],    /* INIB */\n"
    4156                   end
     4365                  # if @singleton then
     4366                  #   f.print "    &#{@global_name}_SINGLE_CELL_INIB,      /* INIB 1 */\n"
     4367                  # else
     4368                  #   f.print "    &#{@global_name}_INIB_tab[#{index}],    /* INIB 2 */\n"
     4369                  # end
     4370                  f.print "    &#{name_array[5]},      /* INIB 1 */\n"
    41574371                else
    41584372                  f.print "    0,\n"
     
    41784392            else
    41794393              if has_CB? then
    4180                 if @singleton then
    4181                   f.print "    &#{@global_name}_SINGLE_CELL_CB,       /* CB */\n"
    4182                 else
    4183                   f.print "    &#{@global_name}_CB_tab[#{index}],     /* CB */\n"
    4184                   # f.print "    &#{@global_name}_#{c.get_name}_CB,\n"
    4185                 end
     4394                # if @singleton then
     4395                #   f.print "    &#{@global_name}_SINGLE_CELL_CB,       /* CB 3 */\n"
     4396                # else
     4397                #   f.print "    &#{@global_name}_CB_tab[#{index}],     /* CB 4 */\n"
     4398                #   # f.print "    &#{@global_name}_#{c.get_name}_CB,\n"
     4399                # end
     4400                f.print "    #{name_array[8]},      /* CB 3 */\n"
    41864401              elsif has_INIB? then
    4187                 if @singleton then
    4188                   f.print "    &#{@global_name}_SINGLE_CELL_INIB,     /* INIB */\n"
    4189                 else
    4190                   f.print "    &#{@global_name}_INIB_tab[#{index}],   /* INIB */\n"
    4191                 end
     4402                # if @singleton then
     4403                #   f.print "    &#{@global_name}_SINGLE_CELL_INIB,     /* INIB 3 */\n"
     4404                # else
     4405                #   # f.print "    &#{@global_name}_INIB_tab[#{index}],   /* INIB 4 */\n"
     4406                # end
     4407                f.print "    &#{name_array[5]},      /* INIB 3 */\n"
    41924408              else
    41934409                f.print "    0,\n"
     
    45504766  def generate_inline_template_code
    45514767    return if @n_entry_port_inline == 0
     4768    return if @b_reuse && ! $generate_all_template
    45524769    if ! ( @plugin && @plugin.gen_ep_func? ) then
    45534770      return if @b_reuse && ! $generate_all_template
     
    49275144  #  str に以下の置換を行う
    49285145  #-   $ct$ ⇒ セルタイプ名(ct)
    4929   #-   $cell$ ⇒ セル名(cell)   cell が nil ならば3つの置換は行われない
     5146  #-   $cell$ ⇒ セル名(cell)   cell が nil ならば以下の置換は行われない
    49305147  #-   $cb$ ⇒ CB の C 言語名(cb)
    49315148  #-   $cbp$ ⇒ CB へのポインタ(cbp)
    49325149  #-   $cb_proto$ ⇒ CB の C 言語名プロトタイプ宣言用(cb_proto)
    4933   #-   $id$ ⇒ ct_cell
     5150  #-   $id$ ⇒ $ct$_$cell_global$    # ct_cell  before or same V1.5.2
    49345151  #-   $idx$ ⇒ idx
    49355152  #-   $ID$ ⇒ id (整数の番号)
    49365153  #-   $ct_global$ ⇒ セルタイプ名(ct)
    4937   #-   $cell_global$ ⇒ セル名(cell)   cell が nil ならば3つの置換は行われない
     5154  #-   $cell_global$ ⇒ セル名(cell)
    49385155  #-   $$   ⇒ $
    49395156  def subst_name( str, name_array )
     
    49505167
    49515168    str = str.gsub( /(^|[^\$])\$ct\$/, "\\1#{ct}" )
     5169    str = str.gsub( /(^|[^\$])\$ct_global\$/, "\\1#{ct_global}" )
    49525170    if cell then
    49535171      str = str.gsub( /(^|[^\$])\$cell\$/, "\\1#{cell}" )
    49545172      str = str.gsub( /(^|[^\$])\$cb\$/, "\\1#{cb}" )
    4955       str = str.gsub( /(^|[^\$])\$id\$/, "\\1#{ct}_#{cell}" )
     5173      # str = str.gsub( /(^|[^\$])\$id\$/, "\\1#{ct}_#{cell}" )
     5174      str = str.gsub( /(^|[^\$])\$id\$/, "\\1#{ct}_#{cell_global}" )
    49565175      str = str.gsub( /(^|[^\$])\$cb_proto\$/, "\\1#{cb_proto}" )
    49575176      str = str.gsub( /(^|[^\$])\$ID\$/, "\\1#{id}" )
    49585177      str = str.gsub( /(^|[^\$])\$idx\$/, "\\1#{idx}" )
    49595178      str = str.gsub( /(^|[^\$])\$cbp\$/, "\\1#{cbp}" )
    4960       str = str.gsub( /(^|[^\$])\$ct_global\$/, "\\1#{ct_global}" )
    49615179      str = str.gsub( /(^|[^\$])\$cell_global\$/, "\\1#{cell_global}" )
    49625180    end
     
    50785296  end
    50795297end
     5298
     5299class DomainType < Node
     5300  def gen_factory
     5301    # p "DomainType: gen_factory"
     5302    @plugin.gen_factory
     5303  end
     5304end
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/location.rb

    r337 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/messages.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/optimize.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2018 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    178178
    179179  def set_domain
     180    domain_cells = {}
    180181    @cell_list.each{ |c|
    181182      if c.is_generate? then
     
    191192          @domain_roots[ dn ] = [ dr ]
    192193        end
     194        if domain_cells[ dr ]  then
     195          domain_cells[ dr ] << c
     196        else
     197          domain_cells[ dr ] = [ c ]
     198        end
    193199      end
    194200    }
     
    196202    @domain_roots.each{ |dn, drs|
    197203      drs.uniq!
    198       if ! $debug then
    199         dbgPrint "domains celltype:#{@name} domain=#{dn} "
     204      if $verbose && dn then
     205        print "[domain] celltype=#{@name} domainType=#{dn} domainRootRegions={"
     206        delim = ""
    200207        drs.each{ |r|
    201           dbgPrint " region=#{r.get_name}"
     208          print delim, r.get_name
     209          delim = ", "
    202210        }
    203         dbgPrint "\n"
     211        print "}\n"
     212        drs.each{ |r|
     213          print "[domain] celltype=#{@name} domainRootRegion=#{r.get_name} domainType=#{dn} domainKind=#{r.get_domain_root.get_domain_type.get_kind} domainCells={"
     214          delim = ""
     215          domain_cells[r].each{ |c|
     216            print delim, c.get_name
     217            delim = ", "
     218          }
     219          print "}\n"
     220        }
    204221      end
    205222    }
     
    212229      # domain_type は一つのノードに一つしかないので、一つの要素を無条件で取り出す
    213230      if regions.length > 1 then
    214         cdl_info( "I9999 celltype:#{@name} has cells in multi domain.\n" )
    215         if @idx_is_id == false then
    216           cdl_info( "I9999 celltype:#{@name} forcely set idx_is_id\n" )
    217         end
    218         @idx_is_id_act = true
     231        if $verbose then
     232          cdl_info( "I9999 celltype '$1' has cells in multi-domain.\n", @name )
     233        end
     234        # if @idx_is_id == false then
     235        #   cdl_info( "I9999 celltype '$1' forcely set idx_is_id\n", @name )
     236        # end
     237        @b_need_ptab = true
     238        # @idx_is_id_act = true
    219239      end
    220240    }
     
    228248    end
    229249
     250    optimize_call
     251    if $unopt_entry == false then
     252      optimize_entry
     253    end
     254  end
     255
     256  #=== Celltype#呼び口最適化
     257  def optimize_call
    230258    @port.each{ |port|
    231259      next if port.get_port_type != :CALL
     
    361389      dbgPrint "#{port.get_name} : # of cells : #{port_cells.length}  # of ports : #{port_ports.length}\n"
    362390    }
    363 
     391  end
     392
     393  #=== Celltype#受け口最適化
     394  # optimize_entry は、呼び口最適化の結果を使用している
     395  def optimize_entry
    364396    # 受け口最適化の設定
    365397    @port.each{ |port|
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/plugin.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    160160      #  識別子取得
    161161      if arg =~ /\A[a-zA-Z_]\w*/ then
    162         ident = $~
     162        ident = $~.to_s    #
    163163        arg = $'
    164164      else
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/pluginModule.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/syntaxobj.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2016 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    685685  end
    686686
     687  #=== Decl# print_flowinfo
     688  def print_flowinfo file
     689    if @kind == :VAR then
     690      file.write "#{@identifier} "
     691    end
     692  end
     693
    687694  def show_tree( indent )
    688695    indent.times { print "  " }
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tecsgen.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    250250    Cell.create_reverse_join
    251251
     252    DescriptorType.check_signature
     253    Signature.set_descriptor_list
     254    Celltype.check_dynamic_join
     255
    252256    #0 set_definition_join は2回呼び出される(1回目)
    253257    dbgPrint( "## Checking all join\n")
     
    450454  end # finalize
    451455
     456  def dump_tecsgen_rbdmp
     457    dbgPrint "dump_tecsgen_rbdmp 0:\n"
     458    #### unjoin_plugin 後に行う必要があるため、コード生成後にダンプを行う
     459    #### Region link root ごとにオプティマイズしてダンプ ####
     460    Namespace.get_root.unjoin_plugin
     461    Namespace.get_root.find_plugin 0, []
     462
     463    Region.get_link_roots.each { |region|
     464      dbgPrint "dump_tecsgen_rbdmp 1: Region.path_str: #{region.get_namespace_path.get_path_str}\n"
     465
     466      n_cells = region.get_n_cells
     467
     468      if $region_list.length > 0 then
     469        if $region_list[ region.get_namespace_path.get_path_str ] == false then
     470          $region_list[ region.get_namespace_path.get_path_str ] = true
     471        else
     472          next
     473        end
     474      end
     475
     476      dbgPrint "dump_tecsgen_rbdmp 2: Region.path_str: #{region.get_namespace_path.get_path_str}\n"
     477      # セルが一つもなければ生成しない
     478      # セルの生成がない場合
     479      if region.get_n_cells == 0 then
     480        # if $region_list.length > 0 then
     481        #   Generator.warning( "W9999 $1: specified to generate but has no cell", region.get_name )
     482        # end
     483        if region != @root_namespace then
     484          next
     485        end
     486      end
     487
     488      dbgPrint "dump_tecsgen_rbdmp 3: Region.path_str: #{region.get_namespace_path.get_path_str}\n"
     489      $generating_region = region
     490      if Region.get_link_roots.length > 1 then
     491        if region.get_name == "::" then
     492          $gen = $gen_base
     493        else
     494          $gen = $gen_base + "/" + region.get_global_name.to_s
     495        end
     496      else
     497        $gen = $gen_base
     498      end
     499
     500      dbgPrint "dump_tecsgen_rbdmp 4: Region.path_str: #{region.get_namespace_path.get_path_str}\n"
     501      dbgPrint( "## Unset optimize variables\n")
     502      @root_namespace.reset_optimize   # 最適化をリセットする
     503
     504      #  if Generator.get_n_error == 0 then
     505      #   # エラーが発生していたら、ここへは来ない
     506         dbgPrint( "## Set cell id\n")
     507        @root_namespace.set_cell_id_and_domain      # セルの ID とドメイン情報を設定(linkunit 毎に0からつける)
     508
     509        # エラーが発生していたら、最適化は実施しない
     510        if ! $unopt then
     511          dbgPrint( "## Optimizing: Link Region=#{@root_namespace.get_name}\n")
     512          @root_namespace.optimize
     513        end
     514      # end
     515      dbgPrint "dump_tecsgen_rbdmp final: Region.path_str: #{region.get_namespace_path.get_path_str}\n"
     516      File.write( "#{$gen}/tecsgen.rbdmp", Marshal.dump(Namespace.get_root) )
     517    }
     518  end
     519 
    452520  def self.post_coded?
    453521    @@b_post_coded
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tecsinfo.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2017 by TOPPERS Project
     6#   Copyright (C) 2017-2018 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    4949#{indent0}region rTECSInfo {
    5050EOT
    51     # mikan 全部生成するのではなく、region 下のセルのセルタイプと、そこから参照されるシグニチャ、セルタイプに限定して出力する.
     51    Type.reset_print_info
     52
     53    # mikan 全部生成するのではなく、region 下のセルのセルタイプと、そこから参照されるシグニチャ、セルタイプに限定して出力すべき
    5254    # しかし、意味解析後に出力するため、これは容易ではない.最適化とコード生成は、リンクルートごとに行われる.
    5355    Namespace.print_info f, indent
     
    149151                 "#{tag.get_ID_str}_#{decl.get_name}",
    150152                 "(uint32_t)(intptr_t)&(((#{tag.get_type_str}#{tag.get_type_str_post}*)0)->#{decl.get_name})"
     153        f.printf "#define PLACE_OF_%-30s  (%s)\n",
     154                 "#{tag.get_ID_str}_#{decl.get_name}",
     155                 "VARDECL_PLACE_STRUCT"
    151156      }
    152157    }
     
    191196    }
    192197  end
     198
     199  def print_entry_define f
     200    @celltype_list.each { |ct|
     201      if ct.get_cell_list.length > 0 then
     202        ct.print_entry_define f
     203      end
     204    }
     205    @namespace_list.each { |ns|
     206      if ns.instance_of? Namespace then   # region を含めない
     207        ns.print_entry_define f
     208      end
     209    }
     210  end
    193211end
    194212
     
    200218      name = @global_name
    201219    end
     220    # p "region:#{get_name}"
    202221    f.print "\n#{indent}/*** #{get_namespace_path} region information cell ***/\n"
    203222    f.print <<EOT
    204223#{indent}cell nTECSInfo::tRegionInfo #{name}RegionInfo{
    205224#{indent}    name = "#{@name}";
    206 #{indent}};
    207 EOT
     225EOT
     226    @cell_list.each{ |cell|
     227        # print "cell class="+cell.get_celltype.class.name+", " + cell.get_celltype.get_name.to_s + " 1\n"
     228      if ! cell.exclude_info? then
     229        # print "cell class="+cell.get_celltype.class.name+", " + cell.get_celltype.get_name.to_s + " 2\n"
     230        f.print "#{indent}    cCellInfo[] = #{cell.get_global_name}CellInfo.eCellInfo;\n"
     231      end
     232    }
     233    @namespace_list.each { |region|
     234      if region.instance_of? Region then
     235        f.print "#{indent}    cRegionInfo[] = #{region.get_global_name}RegionInfo.eRegionInfo;\n"
     236       end
     237    }
     238    f.print "#{indent}};\n"
     239    @cell_list.each{ |cell|
     240      if ! cell.exclude_info? then
     241        cell.print_info f, indent
     242      end
     243    }
    208244  end
    209245
     
    221257    self.print_info_region f, indent
    222258  end
     259
     260  def self.print_cell_define f
     261    region.get_link_root.print_cell_define f
     262    region.get_link_root.get_region{ |region|
     263      if region.instance_of? Region then
     264        region.print_cell_define_offset f
     265      end
     266
     267    }
     268  end
     269
     270  def print_cell_define f
     271    ct_list = {}
     272    @cell_list.each{ |cell|
     273      next if cell.exclude_info_factory?
     274      ct_list[ cell.get_celltype ] = true
     275    }
     276    f.print "#define TOPPERS_CB_TYPE_ONLY\n"
     277    ct_list.each{ |ct, val|
     278      f.print "#include \"#{ct.get_global_name}_tecsgen.h\"\n"
     279    }
     280    f.print "\n"
     281    @cell_list.each{ |cell|
     282      next if cell.exclude_info_factory?
     283      name_array = cell.get_celltype.get_name_array cell
     284      if cell.get_celltype.has_CB?
     285        cb = "(void*)#{name_array[8]}"
     286        cb_proto = "extern #{cell.get_celltype.get_global_name}_CB #{name_array[4]};\n"
     287      else
     288        cb = "0"
     289        cb_proto = ""
     290      end
     291      if cell.get_celltype.has_INIB?
     292        inib = "(void*)&#{name_array[5]}"
     293        inib_proto = "extern #{cell.get_celltype.get_global_name}_INIB #{name_array[11]};\n"
     294      else
     295        inib = "0"
     296        inib_proto = ""
     297      end
     298      if ! cell.exclude_info_factory? then
     299        f.print <<EOT
     300#{cb_proto}#define  #{cell.get_global_name}__CBP   #{cb}
     301#{inib_proto}#define  #{cell.get_global_name}__INIBP #{inib}
     302EOT
     303      end
     304    }
     305    @namespace_list.each { |region|
     306      if region.instance_of? Region then
     307        region.print_cell_define f
     308      end
     309    }
     310  end
     311
     312  def print_entry_descriptor_define f
     313    @cell_list.each{ |cell|
     314      next if cell.exclude_info_factory?
     315
     316      signatures = {}
     317      cell.get_celltype.get_port_list.each{ |port|
     318        next if port.get_port_type != :ENTRY
     319
     320        if signatures[ port.get_signature ] == nil then
     321          f.print "#include \"#{port.get_signature.get_global_name}_tecsgen.h\"\n"
     322        end
     323        if cell.get_celltype.get_global_name == :nTECSInfo_tRawEntryDescriptorInfo then
     324          f.print "const struct tag_#{cell.get_celltype.get_global_name}_#{port.get_name}_DES "
     325          f.print "#{cell.get_global_name}_#{port.get_name}_des;\n"
     326        else
     327          f.print "extern struct tag_#{port.get_signature.get_global_name}_VDES "
     328          f.print "#{cell.get_global_name}_#{port.get_name}_des;\n"
     329        end
     330      }
     331    }
     332    @namespace_list.each { |region|
     333      if region.instance_of? Region then
     334        region.print_entry_descriptor_define f
     335      end
     336    }
     337  end
    223338end
    224339
     
    227342    f.print <<EOT
    228343#{indent}cell nTECSInfo::tCelltypeInfo #{@global_name}CelltypeInfo {
    229 #{indent}    name            = "#{@name}";
    230 #{indent}    b_singleton     = #{@singleton};
    231 #{indent}    b_IDX_is_ID_act = C_EXP( "#{@global_name}__IDX_is_ID_act" );
    232 #{indent}    b_hasCB         = C_EXP( "#{@global_name}__hasCB" );
    233 #{indent}    b_hasINIB       = C_EXP( "#{@global_name}__hasINIB" );
    234 #{indent}    n_cellInLinUnit = C_EXP( "#{@global_name}__NCELLINLINKUNIT" );
    235 #{indent}    n_cellInSystem  = #{@cell_list.length};
     344#{indent}    name             = "#{@name}";
     345#{indent}    b_singleton      = #{@singleton};
     346#{indent}    b_IDX_is_ID_act  = C_EXP( "#{@global_name}__IDX_is_ID_act" );
     347#{indent}    sizeOfCB         = C_EXP( "#{@global_name}__sizeOfCB" );
     348#{indent}    sizeOfINIB       = C_EXP( "#{@global_name}__sizeOfINIB" );
     349#{indent}    n_cellInLinkUnit = C_EXP( "#{@global_name}__NCELLINLINKUNIT" );
     350#{indent}    n_cellInSystem   = #{@cell_list.length};
    236351EOT
    237352    @port.each{ |port|
     
    273388    }
    274389    @attribute.each{ |decl|
    275       decl.print_info f, @global_name, indent
     390      decl.print_info f, @global_name, indent, :DECLTYPE_ATTR
    276391    }
    277392    @var.each{ |decl|
    278       decl.print_info f, @global_name, indent
     393      decl.print_info f, @global_name, indent, :DECLTYPE_VAR
    279394    }
    280395  end
     
    295410        if ! decl.is_omit? then
    296411          offset = "(uint32_t)(intptr_t)&(((#{@global_name}_#{inib_cb}*)0)->#{decl.get_name})"
     412          place = inib_cb
    297413        else
    298414          offset = "0xffffffff"
     415          place = "NON"
    299416        end
    300417        f.printf "#define OFFSET_OF_%-30s  (%s)\n", "#{@global_name}_#{decl.get_name}", offset
     418        f.printf "#define PLACE_OF_%-30s  VARDECL_PLACE_%s\n", "#{@global_name}_#{decl.get_name}", place
    301419      }
    302420      @var.each{ |decl|
    303         if decl.get_size_is then
     421        if decl.get_size_is && has_INIB? then
    304422          inib_cb = "INIB"
    305423        else
    306424          inib_cb = "CB"
    307425        end
    308           f.printf "#define OFFSET_OF_%-30s  (%s)\n", "#{@global_name}_#{decl.get_name}", "(uint32_t)(intptr_t)&(((#{@global_name}_#{inib_cb}*)0)->#{decl.get_name})"
     426        place = inib_cb
     427        f.printf "#define OFFSET_OF_%-30s  (%s)\n", "#{@global_name}_#{decl.get_name}", "(uint32_t)(intptr_t)&(((#{@global_name}_#{inib_cb}*)0)->#{decl.get_name})"
     428        f.printf "#define PLACE_OF_%-30s  VARDECL_PLACE_%s\n", "#{@global_name}_#{decl.get_name}", place
    309429      }
    310430    else
     
    316436      @attribute.each{ |decl|
    317437        f.printf "#define OFFSET_OF_%-30s  (%s)\n", "#{@global_name}_#{decl.get_name}", "0xffffffff"
     438        f.printf "#define PLACE_OF_%-30s   VARDECL_PLACE_NON\n", "#{@global_name}_#{decl.get_name}"
    318439      }
    319440      @var.each{ |decl|
    320441        f.printf "#define OFFSET_OF_%-30s  (%s)\n", "#{@global_name}_#{decl.get_name}", "0xffffffff"
     442        f.printf "#define PLACE_OF_%-30s   VARDECL_PLACE_NON\n", "#{@global_name}_#{decl.get_name}"
    321443      }
    322444    end
     
    324446
    325447  def print_celltype_define f
    326     f.printf "#define %-50s (#{@idx_is_id_act})\n",     "#{@global_name}__IDX_is_ID_act"
    327     f.printf "#define %-50s (#{has_CB?})\n",            "#{@global_name}__hasCB"
    328     f.printf "#define %-50s (#{has_INIB?})\n",          "#{@global_name}__hasINIB"
    329     f.printf "#define %-30s (%d)\n", "#{@global_name}__NCELLINLINKUNIT", @n_cell_gen
     448    if has_INIB? then
     449      size_INIB = "(sizeof(#{@global_name}_INIB))"
     450    else
     451      size_INIB = "(0)"
     452    end
     453    if has_CB? then
     454      size_CB = "(sizeof(#{@global_name}_CB))"
     455    else
     456      size_CB   = "(0)"
     457    end
     458
     459    if @n_cell_gen > 0 then
     460      f.printf "\n#include \"#{@global_name}_tecsgen.h\"\n"
     461      f.printf "#define %-50s (#{@idx_is_id_act})\n",     "#{@global_name}__IDX_is_ID_act"
     462      f.printf "#define %-50s (#{size_CB})\n",            "#{@global_name}__sizeOfCB"
     463      f.printf "#define %-50s (#{size_INIB})\n",          "#{@global_name}__sizeOfINIB"
     464      f.printf "#define %-30s (%d)\n", "#{@global_name}__NCELLINLINKUNIT", @n_cell_gen
     465    else
     466      f.printf "#define %-50s (false)\n",                 "#{@global_name}__IDX_is_ID_act"
     467      f.printf "#define %-50s (0)\n",                     "#{@global_name}__sizeOfCB"
     468      f.printf "#define %-50s (0)\n",                     "#{@global_name}__sizeOfINIB"
     469      f.printf "#define %-30s (%d)\n", "#{@global_name}__NCELLINLINKUNIT", @n_cell_gen
     470    end
    330471  end
    331472
     
    365506        end
    366507      end
    367       if ( port.is_VMT_useless? && port.is_cell_unique? ) || @n_cell_gen == 0 then
     508      if ( port.is_VMT_useless? && port.is_cell_unique? ) || port.is_omit? || @n_cell_gen == 0 then
    368509        offset = "0xffffffff"
    369510      else
     
    375516        offset = "(uint32_t)(intptr_t)&((#{@global_name}_#{cb_inib}*)0)->#{port.get_name}"
    376517      end
     518      array_size = port.get_array_size
     519      if array_size == "[]" then
     520        array_size = "0xffffffff"
     521      elsif array_size == nil then
     522        array_size = "0"
     523      end
     524
    377525      f.printf "#define %-50s (#{offset})\n",                   "#{@global_name}_#{port.get_name}__offset"
     526      f.printf "#define %-50s (#{array_size})\n",               "#{@global_name}_#{port.get_name}__array_size"
    378527      f.printf "#define %-50s (#{place})\n",                    "#{@global_name}_#{port.get_name}__place"
    379528      f.printf "#define %-50s (#{port.is_VMT_useless?})\n",     "#{@global_name}_#{port.get_name}__b_VMT_useless"
     
    382531    }
    383532  end
     533
     534  def print_entry_define f
     535    @port.each{ |port|
     536      next if port.get_port_type == :CALL
     537      array_size = port.get_array_size
     538      if array_size == "[]" then
     539        array_size = "0xffffffff"
     540      elsif array_size == nil then
     541        array_size = "0"
     542      end
     543
     544      f.printf "#define %-50s (#{array_size})\n",               "#{@global_name}_#{port.get_name}__array_size"
     545    }
     546  end
    384547end
    385548
     
    393556#{indent}    cSignatureInfo  = #{@signature.get_global_name}SignatureInfo.eSignatureInfo;
    394557#{indent}    b_inline        = #{@b_inline};
     558#{indent}    array_size      = C_EXP( "#{ct_global}_#{@name}__array_size" );
    395559#{indent}};
    396560EOT
     
    401565#{indent}    cSignatureInfo  = #{@signature.get_global_name}SignatureInfo.eSignatureInfo;
    402566#{indent}    offset            = C_EXP( "#{ct_global}_#{@name}__offset" );
     567#{indent}    array_size        = C_EXP( "#{ct_global}_#{@name}__array_size" );
    403568#{indent}    b_optional        = #{@b_optional};
    404569#{indent}    b_omit            = #{@b_omit};
     
    418583end
    419584
     585class Cell
     586  def print_info f, indent
     587    if exclude_info? then
     588      return
     589    end
     590    f.print <<EOT
     591
     592#{indent}/*** #{@global_name} cell information ****/
     593#{indent}cell nTECSInfo::tCellInfo #{@global_name}CellInfo {
     594#{indent}    name            = "#{@name}";
     595#{indent}    cbp             = C_EXP( \"#{@global_name}__CBP\" );
     596#{indent}    inibp           = C_EXP( \"#{@global_name}__INIBP\" );
     597#{indent}    cCelltypeInfo   = #{@celltype.get_global_name}CelltypeInfo.eCelltypeInfo;
     598EOT
     599    @celltype.get_port_list.each{ |port|
     600      next if port.get_port_type != :ENTRY
     601
     602      f.print <<EOT
     603#{indent}    cRawEntryDescriptor[] = #{@global_name}_#{port.get_name}RawEntryDescriptorInfo.eRawEntryDescriptor;
     604EOT
     605    }
     606    f.print "#{indent}};\n"
     607
     608    # RawEntryDescriptorInfo cells
     609    @celltype.get_port_list.each{ |port|
     610      next if port.get_port_type != :ENTRY
     611
     612      size = port.get_array_size
     613      if size == nil then
     614        size = 1
     615      elsif size == "[]" then
     616        size = @entry_array_max_subscript[ port ]
     617      end
     618      if ! port.is_omit? then
     619        red = "C_EXP( \"&#{@global_name}_#{port.get_name}_des\" )"
     620      else
     621        red = "(void *)0"
     622      end
     623      # mikan 受け口配列
     624      f.print <<EOT
     625#{indent}cell nTECSInfo::tRawEntryDescriptorInfo #{@global_name}_#{port.get_name}RawEntryDescriptorInfo {
     626#{indent}   size = #{size};
     627#{indent}   rawEntryDescriptor = { #{red} };
     628EOT
     629#  #{indent}   cEntryInfo = #{@celltype.get_global_name}_#{port.get_name}EntryInfo.eEntryInfo;
     630      f.print "#{indent}};\n"
     631    }
     632  end
     633
     634  def exclude_info?
     635    # print "exclude_info?: name=" + get_name.to_s
     636    if @celltype == nil ||
     637       is_of_composite? ||
     638       @celltype.get_global_name == :nTECSInfo_tTECSInfoSub ||
     639       post_code_generated? ||
     640       @b_defined == false then
     641      # print ": true celltype_is_of_composite=#{is_of_composite?} celltype_name=#{@celltype.get_global_name} celltype.need_generate=#{@celltype.need_generate?}\n"
     642      return true
     643    else
     644      # print ": false\n"
     645      return false
     646    end
     647  end
     648
     649  def exclude_info_factory?
     650    # print "exclude_info_factory?: name=" + get_name.to_s
     651    if @celltype == nil ||
     652       is_of_composite? ||
     653       @celltype.get_global_name == :nTECSInfo_tTECSInfoSub ||
     654       ! @celltype.need_generate? then
     655      # print ": true celltype_is_of_composite=#{is_of_composite?} celltype_name=#{@celltype.get_global_name} celltype.need_generate=#{@celltype.need_generate?}\n"
     656      return true
     657    else
     658      # print ": false\n"
     659      return false
     660    end
     661  end
     662end
     663
    420664class Signature
    421665  def print_info f, indent
     
    446690    f.print <<EOT
    447691#{indent}cell nTECSInfo::tFunctionInfo #{sig_name}_#{func_name}FunctionInfo {
    448 #{indent}    name            = "#{@owner.get_global_name}_#{@name}";
     692#{indent}    name            = "#{get_name}";
    449693#{indent}    bOneway         = #{is_oneway?};
    450694EOT
     
    502746
    503747class Decl
    504   def print_info f, parent_ID_str, indent
     748  def print_info f, parent_ID_str, indent, decl_type
    505749    if @size_is then
    506750      size = "\"mikan\"";
     
    512756#{indent}    name            = "#{get_name}";
    513757#{indent}    sizeIsExpr      = #{size};
    514 #{indent}    declType        = DECLTYPE_STMEMBER;
     758#{indent}    declType        = #{decl_type};
    515759#{indent}    offset          = C_EXP( "OFFSET_OF_#{parent_ID_str}_#{get_name}" );
     760#{indent}    place           = C_EXP( "PLACE_OF_#{parent_ID_str}_#{get_name}" );
    516761#{indent}    cTypeInfo       = #{get_type.get_ID_str}TypeInfo.eTypeInfo;
    517762#{indent}};
     
    523768class Type
    524769  @@typeinfo_printed = {}
     770
     771  def self.reset_print_info
     772    @@typeinfo_printed = {}
     773  end
     774
    525775  def print_info f, indent
    526776    # Type の info は、最後にまとめて出力するので、ここでは記録するだけ
     
    538788    elsif self.kind_of? StructType then
    539789      get_members_decl.get_items.each{ |decl|
    540         decl.get_type.print_info f, indent
     790        decl.print_info f, get_ID_str, indent, :DECLTYPE_STMEMBER
    541791      }
    542792    end
     
    550800
    551801  def print_info_post f, indent
    552     bit_size = get_bit_size
    553     if bit_size == 0 then
    554       bit_size = "C_EXP( \"sizeof(#{get_type_str}#{get_type_str_post})\" )"
    555     end
    556802    if self.class.superclass == Type then     # 親クラスが Type の場合 types.rb のクラス
    557803      type_name = self.class.name
     
    566812#{indent}    name           = "#{get_type_str}#{get_type_str_post}";
    567813#{indent}    typeKind       = TECSTypeKind_#{type_name};
    568 #{indent}    bitSize        = #{bit_size};
     814#{indent}    size           = C_EXP( "sizeof(#{get_type_str}#{get_type_str_post})" );
    569815#{indent}    b_const        = #{is_const?};
    570816#{indent}    b_volatile     = #{is_volatile?};
    571817EOT
    572818    if self.kind_of? PtrType then
    573       f.print "#{indent}    cTypeInfo      = #{get_referto.get_ID_str}TypeInfo.eTypeInfo;\n"
     819      f.print "#{indent}    cTypeInfo        = #{get_referto.get_ID_str}TypeInfo.eTypeInfo;\n"
    574820    elsif self.kind_of? ArrayType then
    575       f.print "#{indent}    cTypeInfo      = #{get_type.get_ID_str}TypeInfo.eTypeInfo;\n"
     821      f.print "#{indent}    cTypeInfo        = #{get_type.get_ID_str}TypeInfo.eTypeInfo;\n"
    576822    elsif self.kind_of? DefinedType then
    577       f.print "#{indent}    cTypeInfo      = #{get_type.get_ID_str}TypeInfo.eTypeInfo;\n"
     823      f.print "#{indent}    cTypeInfo        = #{get_type.get_ID_str}TypeInfo.eTypeInfo;\n"
    578824    elsif self.kind_of? StructType then
    579825      get_members_decl.get_items.each{ |decl|
    580         f.print "#{indent}    cTypeInfo[]    = #{decl.get_type.get_ID_str}TypeInfo.eTypeInfo;\n"
     826        f.print "#{indent}    cVarDeclInfo[] = #{get_ID_str}_#{decl.get_name}VarDeclInfo.eVarDeclInfo;\n"
    581827      }
    582828    elsif self.kind_of? DescriptorType then
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tool_info.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/types.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55#
    6 #   Copyright (C) 2008-2015 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#-- 
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    629629
    630630class FloatType < Type
    631 #  @bit_size::         32, 64, (80), -32, -64
     631#  @bit_size::         32, 64, (80), -32, -64, -128
    632632
    633633  def initialize( bit_size )
     
    684684    when -64
    685685      str = "#{str}double"
     686    when -128
     687      str = "#{str}long double"
    686688    end
    687689    return str
     
    15581560# 動的結合で渡すデスクリプタ型
    15591561class DescriptorType < Type
    1560 # @sinagure_nsp::NamespacePath
     1562  # @sinagure_nsp::NamespacePath
     1563
     1564  @@descriptors = {}
    15611565
    15621566  def initialize( signature_nsp )
    1563     # p "Desc #{signature_nsp.to_s}"
    1564     obj = Namespace.find signature_nsp
    1565     if ! obj.kind_of? Signature then
    1566       cdl_error( "T9999 '$1': not signature or not found", signature_nsp.to_s )
    1567       @signature_nsp = signature_nsp
    1568     else
    1569       if obj.has_descriptor? then
    1570        # cdl_error( "T9999 '$1': has Descriptor in function parameter", signature_nsp.to_s )
    1571       end
    1572       @signature_nsp = obj.get_namespace_path
    1573     end
     1567    @signature_nsp = signature_nsp
     1568    # check_signature ##
     1569    @@descriptors[ self ] = false
    15741570  end
    15751571
     
    15951591    else
    15961592      cdl_error2( locale, "T9999 Descriptor cannot be used for $1", kind)
     1593    end
     1594  end
     1595
     1596  def self.check_signature
     1597    @@descriptors.each{ |desc, val|
     1598      if val != true then
     1599        desc.check_signature
     1600        @@descriptors[ desc ] = true
     1601      end
     1602    }
     1603  end
     1604 
     1605  def check_signature
     1606    # p "Desc #{@signature_nsp.to_s}"
     1607    obj = Namespace.find @signature_nsp
     1608    if ! obj.kind_of? Signature then
     1609      cdl_error( "T9999 '$1': not signature or not found", @signature_nsp.to_s )
     1610    else
     1611      if obj.has_descriptor? then
     1612       # cdl_error( "T9999 '$1': has Descriptor in function parameter", @signature_nsp.to_s )
     1613      end
     1614      # @signature_nsp = obj.get_namespace_path
    15971615    end
    15981616  end
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_console_en_US.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_console_ja_JP.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_file_en_US.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2018 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    7676#  * このファイルを編集して使用することが意図されていますが
    7777#  * tecsgen の再実行により上書きされてしまうため、通常
    78 #  *   gen/%s_template.c => src/%s.c
     78#  *   gen/%s_templ.c => src/%s.c
    7979#  * のように名前, フォルダを変更してから修正します
    8080#  */
     
    8383 * This file was automatically generated by tecsgen.
    8484 * Move and rename like below before editing,
    85  *   gen/%s_template.c => src/%s.c
     85 *   gen/%s_templ.c => src/%s.c
    8686 * to avoid to be overwritten by tecsgen.
    8787 */
     
    335335@@comment[ :TEFB_comment ] = "\t/* Put statements here %s */\n"
    336336
     337# @@comment[ :MCPP_comment ] = "/* セル CB プロトタイプ宣言 %s */\n"
     338@@comment[ :MCPP_comment ] = "/* cell CB prototype declaration %s */\n"
     339
     340# @@comment[ :MCPB_comment ] = "/* セル CB プロトタイプ宣言 %s */\n"
     341@@comment[ :MCPB_comment ] = "/* cell CB prototype declaration %s */\n"
    337342end
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_file_ja_JP.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2018 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    6565 * このファイルを編集して使用することが意図されていますが
    6666 * tecsgen の再実行により上書きされてしまうため、通常
    67  *   gen/%s_template.c => src/%s.c
     67 *   gen/%s_templ.c => src/%s.c
    6868 * のように名前, フォルダを変更してから修正します
    6969 */
     
    163163@@comment[ :TEPF_comment ] = "/* 受け口関数 %s */\n"
    164164@@comment[ :TEFB_comment ] = "\t/* ここに処理本体を記述します %s */\n"
     165@@comment[ :MCPP_comment ] = "/* CB プロトタイプ宣言 %s */\n"
     166@@comment[ :MCPB_comment ] = "/* CB プロトタイプ宣言 %s */\n"
    165167
    166168end
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1AlarmPlugin.rb

    r337 r374  
    3535#   の責任を負わない.
    3636
    37 #   $Id
     37#   $Id$
    3838#++
    3939
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1DelayTaskPlugin.rb

    r337 r374  
    3535#   の責任を負わない.
    3636
    37 #   $Id
     37#   $Id$
    3838#++
    3939
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1ISRPlugin.rb

    r337 r374  
    3535#   の責任を負わない.
    3636
    37 #   $Id
     37#   $Id$
    3838#++
    3939
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1KernelPlugin.rb

    r337 r374  
    3535#   の責任を負わない.
    3636
    37 #   $Id
     37#   $Id$
    3838#++
    3939
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1ResourcePlugin.rb

    r337 r374  
    3535#   の責任を負わない.
    3636
    37 #   $Id
     37#   $Id$
    3838#++
    3939
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1TaskPlugin.rb

    r337 r374  
    3535#   の責任を負わない.
    3636
    37 #   $Id
     37#   $Id$
    3838#++
    3939
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/DomainPlugin.rb

    r337 r374  
    4646  #option::String : domain 指定子の第二引数
    4747  def initialize( region, domain_type_name, option )
     48    super()
    4849  end
    4950
     
    7778    return false
    7879  end
     80
     81  #== ドメイン種別を返す
     82  #return::Symbol :kernel, :user, :OutOfDomain
     83  def get_kind
     84    :kernel
     85  end
     86
     87  #== factory 生成
     88  # DomainPlugin の factory は特定のファイルへの出力が想定されていない
     89  def gen_factory
     90  end
    7991end
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Cache.rb

    r337 r374  
    11# -*- coding: utf-8 -*-
    22
     3#   $Id$
    34
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2CyclicHandlerPlugin.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2012 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2DataqueuePlugin.rb

    r337 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2012 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    3535#   の責任を負わない.
    3636
     37#   $Id$
    3738#++
    3839
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2EventflagPlugin.rb

    r337 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2012 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    3535#   の責任を負わない.
    3636
     37#   $Id$
    3738#++
    3839
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2FixedSizeMemoryPoolPlugin.rb

    r337 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2012 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    3535#   の責任を負わない.
    3636
     37#   $Id$
    3738#++
    3839
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2HandlerPlugin.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2018 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    7777        elsif @plugin_arg_str == "ISR"
    7878            file.print <<EOT
    79 #{tab}ATT_ISR({ #{val[:attribute]}, &#{cell_CB_name}, #{val[:interruptNumber]}, tISR_start, #{val[:priority]} });
     79#{tab}ATT_ISR({ #{val[:attribute]}, #{cell_CBP}, #{val[:interruptNumber]}, tISR_start, #{val[:priority]} });
    8080EOT
    8181        elsif @plugin_arg_str == "INIT_ROUTINE"
    8282            file.print <<EOT
    83 #{tab}ATT_INI({ #{val[:attribute]}, &#{cell_CB_name}, tInitializeRoutine_start });
     83#{tab}ATT_INI({ #{val[:attribute]}, #{cell_CBP}, tInitializeRoutine_start });
    8484EOT
    8585        elsif @plugin_arg_str == "TERM_ROUTINE"
    8686            file.print <<EOT
    87 #{tab}ATT_TER({ #{val[:attribute]}, &#{cell_CB_name}, tTerminateRoutine_start });
     87#{tab}ATT_TER({ #{val[:attribute]}, #{cell_CBP}, tTerminateRoutine_start });
    8888EOT
    8989        else
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2KernelObjectPlugin.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2012 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    186186                val = {}
    187187                @celltype.get_attribute_list.each{ |a|
    188                     p a.get_name
     188                    # p a.get_name
    189189                    if a.get_type.kind_of?( ArrayType )
    190190                        val[a.get_name] = []
     
    218218                if val[:id].nil? != true
    219219                    puts val[:id]
    220                     val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" )
     220                    #val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" )
     221                    val[:id] = @celltype.subst_name( val[:id], @celltype.get_name_array( cell ) )
    221222                end
    222223                # $cbp$の代わり
     
    244245                        file2.puts "}\n"
    245246                    else
    246                         print "~~~~~ #{cell.get_region.get_name.to_s} is included in"
    247                         p @@region_list
     247                        dbgPrint "~~~~~ #{cell.get_region.get_name.to_s} is included in"
     248                        # p @@region_list
    248249                    end
    249250                    file3 = AppFile.open( "#{$gen}/tecsgen_#{cell_domain_root.get_name.to_s}.cfg" )
     
    260261                if !val[:accessPattern].nil?
    261262                    puts "===== begin check regions #{cell.get_name} ====="
    262                     p val[:accessPattern]
    263                     p val[:accessPattern].class
     263                    # p val[:accessPattern]
     264                    # p val[:accessPattern].class
    264265
    265266                    #ep = [ :eTaskActivate, :eTaskControl, :eTaskManage, :eTaskRefer ]
     
    273274                        if acptnx != "OMIT"
    274275                            acv << acptnx
    275                             p acv[i]
     276                            # p acv[i]
    276277                        elsif cell_domain_type.get_option.to_s == "trusted"
    277278                            acv << "TACP_KERNEL"
    278                             p acv[i]
     279                            # p acv[i]
    279280                        elsif cell_domain_type.get_option.to_s != "OutOfDomain"
    280281                            acv << "TACP(#{cell_domain_root.get_name.to_s})"
     
    286287                    }
    287288
    288                     print "acv = "
     289                    dbgPrint "acv = "
    289290                    p acv
    290291
     
    322323
    323324    def self.check_referenced_cells()
    324         puts "===== begin check registered celltype ====="
     325        dbgPrint "===== begin check registered celltype =====\n"
    325326        self.get_celltype_list.each { |ct|
    326             p ct.get_name.to_s
     327            dbgPrint( ct.get_name.to_s + "\n" )
    327328        }
    328         puts "===== end check registered celltype ====="
     329        dbgPrint "===== end check registered celltype =====\n"
    329330
    330331=begin
     
    334335                j = cell.get_join_list.get_item(p.get_name)
    335336                printf "===== check call port : "
    336                 p p.get_name.to_s
     337                # p p.get_name.to_s
    337338                next if j.nil? # 未結合の場合
    338339                if @@celltype_list.include?(j.get_celltype)
     
    341342                    j.get_cell.set_referenced_cell(cell, j.get_port_name)
    342343                    printf "===== check joined rhs cell : "
    343                     p j.get_cell.get_name.to_s
     344                    # p j.get_cell.get_name.to_s
    344345                    printf "===== check joined rhs port_name : "
    345                     p j.get_port_name
     346                    # p j.get_port_name
    346347                end
    347348            }
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2ObjectPlugin.rb

    r337 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    3535#   の責任を負わない.
    3636
     37#   $Id$
    3738#++
    3839
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Plugin.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2014 by TOPPERS Project
     6#   Copyright (C) 2018 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    4444
    4545  def initialize( region, name, option )
     46    super
    4647    print "HRP2Plugin: initialize: region=#{region.get_name}, domainName=#{name}, option=#{option}\n"
     48    @region = region
     49    @name   = name
     50
     51    case option
     52    when "trusted", "nontrusted", "OutOfDomain"
     53      # OK
     54      @option = option
     55    else
     56      cdl_error( "HRPPlugin: '$1' is unacceptable domain kind, specify 'trusted' or 'nontrusted'", option )
     57      @option = "trusted"   # とりあえず trusted を設定しておく
     58    end
    4759  end
    4860
     
    108120  end
    109121
     122  #== ドメイン種別を返す
     123  #return::Symbol :kernel, :user, :OutOfDomain
     124  def get_kind
     125    case @option
     126    when "trusted"
     127      return :kernel
     128    when "nontrusted"
     129      return :user
     130    when "OutOfDomain"
     131      return :OutOfDomain
     132    end
     133  end
     134
    110135  def joinable?(current_region, next_region, through_type )
    111136    print "HRP2Plugin: joinable? from #{current_region.get_name} to #{next_region.get_name} (#{through_type})\n"
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2PostHook.rb

    r337 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2012 by TOPPERS Project
     6#   Copyright (C) 2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    3535#   の責任を負わない.
    3636
     37#   $Id$
    3738#++
    3839
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2PriorityDataqueuePlugin.rb

    r337 r374  
    3535#   の責任を負わない.
    3636
     37#   $Id$
    3738#++
    3839
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2RPCPlugin.rb

    r337 r374  
    3535#   の責任を負わない.
    3636
     37#   $Id$
    3738#++
    3839
     
    7071  #=== RPCPlugin の initialize
    7172  #  説明は ThroughPlugin (plugin.rb) を参照
    72   def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
     73  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
    7374    super
    7475    @b_noClientSemaphore = false
     
    234235    if cell.get_allocator_list.length > 0 then
    235236
    236       dbgPrint "make allocator"
     237      dbgPrint "make allocator\n"
    237238      file.print "#{indent_str}[allocator("
    238239
     
    269270    nest = @end_region.gen_region_str_pre file
    270271    indent_str = "  " * nest
     272    nest_str = "  " * nest
     273    if @next_cell_port_subscript then
     274      subscript = '[' + @next_cell_port_subscript.to_s + ']'
     275    else
     276      subscript = ""
     277    end
    271278
    272279    file.print <<EOT
    273280#{indent_str}cell #{@rpc_channel_celltype_name}Server #{@cell_name}Body {
    274 #{indent_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name};
     281#{indent_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
    275282//#{indent_str}    #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name};
    276283#{indent_str}  //cTDR         = #{@channelCellName}.eTDR;
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SVCPlugin.rb

    r337 r374  
    3535#   の責任を負わない.
    3636
     37#   $Id$
    3738#++
    3839
     
    8384  @@generated_celltype_header = {}
    8485
    85   def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
     86  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
    8687    super
    8788    @ct_name_body = "#{@ct_name}SVCBody_#{@next_cell.get_name}_#{@next_cell_port_name}".to_sym
     
    217218    nest = @end_region.gen_region_str_pre file
    218219    nest_str = "  " * nest
     220    if @next_cell_port_subscript then
     221      subscript = '[' + @next_cell_port_subscript.to_s + ']'
     222    else
     223      subscript = ""
     224    end
    219225
    220226    # サーバー側チャンネルの生成
     
    224230#{nest_str}  //  Server Side Channel
    225231#{nest_str}  cell #{@ct_name_body} #{@cell_name_body}{
    226 #{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name};
     232#{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
    227233#{nest_str}  };
    228234EOT
     
    241247    nest = @start_region.gen_region_str_pre file
    242248    nest_str = "  " * nest
     249    if @next_cell_port_subscript then
     250      subscript = '[' + @next_cell_port_subscript.to_s + ']'
     251    else
     252      subscript = ""
     253    end
    243254
    244255    # クライアント側チャンネルの生成
     
    247258#{nest_str}  //  Client Side Channel
    248259#{nest_str}  cell #{@ct_name} #{@cell_name}{
    249 #{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name};
     260#{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
    250261#{nest_str}  };
    251262
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SemaphorePlugin.rb

    r337 r374  
    3535#   の責任を負わない.
    3636
     37#   $Id$
    3738#++
    3839
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2TaskPlugin.rb

    r359 r374  
    5353    # tab  :
    5454    def print_cfg_cre(file, cell, val, tab)
    55         val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" )
     55        #val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_global_name.to_s}" )
     56        #val[:id] = @celltype.subst_name( val[:id], @celltype.get_name_array( cell ) )
    5657        # $cbp$の代わり
    5758        index = cell.get_id - @celltype.get_id_base
     
    5960        cell_CB_name = "#{index}"
    6061        # CRE_XXX/DEF_XXXの生成
    61         print "assign task plugin\n"
     62        dbgPrint "assign task plugin\n"
    6263        domainOption = cell.get_region.get_domain_root.get_domain_type.get_option
    6364        # if cell.get_region.get_region_type == :DOMAIN
     65# cell.show_tree 1
    6466        if domainOption != "OutOfDomain"
    6567            # 保護ドメインに属する場合
     
    6971                    raise "system task cannot have user stack."
    7072                end
     73p "CRE_TSK 0 user=#{val[:userStackSize]} system=#{val[:systemStackSize]}"
    7174                file.print <<EOT
    7275#{tab}CRE_TSK(#{val[:id]}, { #{val[:taskAttribute]}, #{cell_CB_name}, tTask_start_task, #{val[:priority]}, #{val[:systemStackSize]}, NULL });
     
    7780                    raise "user task must have user stack."
    7881                end
     82p "CRE_TSK 1"
    7983                if val[:systemStackSize] == "OMIT"
    8084                    file.print <<EOT
     
    8286EOT
    8387                else
     88p "CRE_TSK 2"
    8489                    file.print <<EOT
    8590#{tab}CRE_TSK(#{val[:id]}, { #{val[:taskAttribute]}, #{cell_CB_name}, tTask_start_task, #{val[:priority]}, #{val[:userStackSize]}, NULL, #{val[:systemStackSize]}, NULL });
     
    138143                    regions = ct.get_domain_roots
    139144                    regions_hrp2 = regions[ :HRP2 ]
    140                     print "HRP2 domain in #{ct.get_name}: "
     145                    dbgPrint "HRP2 domain in #{ct.get_name}: "
    141146                    regions_hrp2.each { |reg|
    142                         print reg.get_name
     147                        dbgPrint reg.get_name
    143148                    }
    144149                    puts ""
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgePlugin.rb

    r359 r374  
    33#  mruby => TECS bridge
    44
    5 #   Copyright (C) 2008-2015 by TOPPERS Project
     5#   Copyright (C) 2008-2017 by TOPPERS Project
    66#
    77#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MultiPlugin.rb

    r359 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2017 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/NotifierPlugin.rb

    r359 r374  
    11# -*- coding: utf-8 -*-
     2#
     3#  TECS Generator
     4#      Generator for TOPPERS Embedded Component System
    25#
    36#  Copyright (C) 2015 by Ushio Laboratory
     
    58#  Copyright (C) 2015-2016 by Embedded and Real-Time Systems Laboratory
    69#              Graduate School of Information Science, Nagoya Univ., JAPAN
     10#  Copyright (C) 2015-2018 by TOPPERS Project
    711#
     12#--
     13#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     14#   ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
     15#   変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
     16#   (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
     17#       権表示,この利用条件および下記の無保証規定が,そのままの形でソー
     18#       スコード中に含まれていること.
     19#   (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
     20#       用できる形で再配布する場合には,再配布に伴うドキュメント(利用
     21#       者マニュアルなど)に,上記の著作権表示,この利用条件および下記
     22#       の無保証規定を掲載すること.
     23#   (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
     24#       用できない形で再配布する場合には,次のいずれかの条件を満たすこ
     25#       と.
     26#     (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
     27#         作権表示,この利用条件および下記の無保証規定を掲載すること.
     28#     (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
     29#         報告すること.
     30#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
     31#       害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
     32#       また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
     33#       由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
     34#       免責すること.
     35
     36#   本ソフトウェアは,無保証で提供されているものである.上記著作権者お
     37#   よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
     38#   に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
     39#   アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
     40#   の責任を負わない.
     41
     42#  $Id$
     43#++
    844
    945NotifierPluginArgProc = {
     
    128164                        # @param [Cell, Symbol] cell セル.セルについて一般化する場合は `:generic`
    129165                        # @param [Integer, Symbol, nil] subscript 添字.添字について一般化する場合は `:generic`
     166                        # @param [Celltype] 呼び先のセルタイプ、cell==:generic の場合のみ有効
    130167                        # @private
    131                         def generate_inner(context, fn_name, cell, subscript)
     168                        def generate_inner(context, fn_name, cell, subscript, callee_ct=nil)
    132169                                source_file = context.source_file
    133170                                header_file = context.header_file
     
    141178                                unless ct.is_singleton?
    142179                                        if cell == :generic
    143                                                 params << "(CELLIDX)extinf"
     180                                                params << "(#{callee_ct.get_global_name}_IDX)extinf"
     181                                                # params << "(CELLIDX)extinf"
    144182                                        else
    145183                                                # セルのCELLIDXを得る
     
    233271
    234272                                                generate_inner context, fn_name,
    235                                                         :generic, subscript
     273                                                        :generic, subscript, ct
    236274
    237275                                                props.each { |prop|
     
    445483            # join:: Join : 結合 (declarationがPortであるもの)
    446484                def validate_join(handler, cell, join)
    447                 return !generate_attr_map(handler, cell).nil?
     485        return !generate_attr_map(handler, cell).nil?
    448486                end
    449487
     
    872910        parse_plugin_arg
    873911        unless @factory
    874                 cdl_error("ASP1003 celltype $1: option factory is not specified",
     912                cdl_error("NTF1003 celltype $1: option factory is not specified",
    875913                        celltype.get_name)
    876914        end
    877915        unless @output_file
    878                 cdl_error("ASP1003 celltype $1: option output_file is not specified",
     916                cdl_error("NTF1003 celltype $1: option output_file is not specified",
    879917                        celltype.get_name)
    880918        end
     
    883921    def set_factory(template_string)
    884922        unless @factory.nil?
    885                 cdl_error("ASP1003 celltype $1: option factory was specified more than once",
     923                cdl_error("NTF1003 celltype $1: option factory was specified more than once",
    886924                        celltype.get_name)
    887925        end
     
    891929    def set_factory_output_file(output_file)
    892930        unless @output_file.nil?
    893                 cdl_error("ASP1003 celltype $1: option output_file was specified more than once",
     931                cdl_error("NTF1003 celltype $1: option output_file was specified more than once",
    894932                        celltype.get_name)
    895933        end
     
    898936
    899937    def gen_factory file
    900         puts "===== begin #{@celltype.get_name.to_s} plugin ====="
     938        # puts "===== begin #{@celltype.get_name.to_s} plugin ====="
    901939
    902940        kernelCfg = AppFile.open( "#{$gen}/#{@output_file}" )
     
    922960                        subst_attr = @celltype.find(name)
    923961                        unless subst_attr
    924                         cdl_error( "ASP1007 celltype $1: additional_param: attribute $2 does not exist.",
     962                        cdl_error( "NTF1007 celltype $1: additional_param: attribute $2 does not exist.",
    925963                                @celltype.get_name, name)
    926964                        end
     
    935973
    936974        kernelCfg.close
    937         puts "===== end #{@celltype.get_name.to_s} plugin ====="
     975        # puts "===== end #{@celltype.get_name.to_s} plugin ====="
    938976    end
    939977
    940978    def gen_factory_for_cell(kernelCfg, cell)
     979      # print "########## gen_factory_for_cell cell=#{cell.get_name}\n"
    941980        handler_flags = []
    942981        handler_args = []
     
    959998                        when 'false' then ignoreErrors = false
    960999                        else
    961                                 cdl_warning( "ASP1005 cell $1: unrecognized value '$2' specified for ignoreErrors",
     1000                                cdl_warning2( cell.get_locale, "NTF1005 cell $1: unrecognized value '$2' specified for ignoreErrors",
    9621001                                        cell.get_name, ignoreErrors )
    9631002                                ignoreErrors = false
    9641003                end
    9651004
     1005    # ドメイン指定用文字列
     1006    pre_text  = ""
     1007    post_text = "\n"
     1008    indent    = ""
     1009 
    9661010        [EVENT_HANDLER, ERROR_HANDLER].each { |handler|
    9671011                # 呼び口の結合を取得
    9681012                call_join = cell.get_join_list.get_item(handler.call_port_name.to_sym)
     1013        domain_root = cell.get_region.get_domain_root
     1014        if cell.get_region.get_domain_root.get_domain_type then
     1015          # print "cell=#{cell.get_name} domain_root=#{domain_root.get_name} domain_type=#{domain_root.get_domain_type.get_name} domain_option=#{domain_root.get_domain_type.get_option}\n"
     1016        else
     1017          # print "cell=#{cell.get_name} domain_root=#{cell.get_region.get_domain_root.get_name}\n"
     1018        end
     1019        if call_join
     1020          # print "validate_join: hanlder=#{handler.class.name} cell=#{cell.get_name} join=#{call_join.get_name} rhs_cell=#{call_join.get_cell}\n"
     1021        else
     1022          # print "validate_join: hanlder=#{handler.class.name} cell=#{cell.get_name}\n"
     1023        end
    9691024
    9701025                # ハンドラタイプを判別する
     
    9741029
    9751030                if matches.length == 0
    976                         cdl_error( "ASP1001 cell $1: no matching handler type found for $2", cell.get_name, handler.call_port_name )
     1031                        cdl_error2( cell.get_locale, "NTF1001 cell $1: no matching handler type found for $2", cell.get_name, handler.call_port_name )
    9771032                        next
    978                 end
     1033        end
    9791034
    9801035                        # 最初に見つかった有効なハンドラタイプを使用
    9811036                ht = matches[0]
     1037
     1038      # ドメインプラグインが指定されている場合、所属ドメインのチェック
     1039      domain_root = cell.get_region.get_domain_root
     1040      if domain_root.get_domain_type then
     1041        if domain_root.get_domain_type.get_name == :HRP then
     1042          option = domain_root.get_domain_type.get_option
     1043          matches.each{ |match|
     1044            # p "match:#{match}"
     1045            case match
     1046            when ActivateTaskHandlerType,       WakeUpTaskHandlerType,
     1047                 SetVariableHandlerType,        SetVariableToErrorCodeHandlerType,
     1048                             IncrementVariableHandlerType,  SignalSemaphoreHandlerType,
     1049                             SetEventflagHandlerType,       SendToDataqueueHandlerType,
     1050                             SendErrorCodeToDataqueueHandlerType
     1051              if option == "OutOfDomain" then
     1052                cdl_error2( cell.get_locale, "NTF9999: NotifierPlugin: $1 cannot be placed out of domain", cell.get_name )
     1053              elsif call_join.get_cell.get_region.get_domain_root == nil ||
     1054                    call_join.get_cell.get_region.get_domain_root != domain_root then
     1055                cdl_error2( cell.get_locale, "NTF9999: NotifierPlugin: $1 and $2 must be placed in same domain", cell.get_name, call_join.get_cell.get_name )
     1056              end
     1057              dbgPrint "#{self.class.name}: match pattern 1.\n"
     1058            when UserHandlerType
     1059              if option != "kernel" then
     1060                cdl_error2( cell.get_locale, "NTF9999: NotifierPlugin: $1 can be placed in kernel domain only, because notify target is handler", cell.get_name )
     1061              elsif call_join.get_cell.get_region.get_domain_root == nil ||
     1062                    call_join.get_cell.get_region.get_domain_root != domain_root then
     1063                cdl_error2( cell.get_locale, "NTF9999: NotifierPlugin: $1 and $2 must be placed in same domain", cell.get_name, call_join.get_cell.get_name )
     1064              end
     1065              dbgPrint "#{self.class.name}: match pattern 2.\n"
     1066                        when NullHandlerType.new  # エラー通知を指定していない
     1067              dbgPrint "#{self.class.name}: match pattern 3.\n"
     1068            end
     1069          }
     1070
     1071          # if cell.get_region.get_param == :KERNEL_DOMAIN
     1072          if option == "kernel"
     1073            pre_text  = "KERNEL_DOMAIN{\n"
     1074            post_text = "}\n"
     1075            indent    =  "\t"
     1076          elsif option != "OutOfDomain" then
     1077            pre_text  = "DOMAIN(#{domain_root.get_name.to_s}){\n"
     1078            post_text = "}\n"
     1079            indent    =  "\t"
     1080          end
     1081        else
     1082          cdl_error( "NTF9999: NotifierPlugin: unknown domain type $1", domain_root.get_domain_type.get_name )
     1083        end
     1084
     1085      end
    9821086
    9831087                        # 通知ハンドラで「エラーが発生するはずがない」のに「エラーハンドラが指定されている」
     
    9861090                        #  なため、検出は行わない。)
    9871091                if handler == ERROR_HANDLER && !ht.is_a?(NullHandlerType) && !event_handler_might_fail
    988                         cdl_error( "ASP1004 cell $1: handler type $2 which never raises an error was inferred for the normal notification handler, but an error notification handler was specified.",
     1092                        cdl_error2( cell.get_locale, "NTF1004 cell $1: handler type $2 which never raises an error was inferred for the normal notification handler, but an error notification handler was specified.",
    9891093                                cell.get_name, handler_flag)
    9901094                end
    9911095                if handler == ERROR_HANDLER && ht.is_a?(NullHandlerType) && event_handler_might_fail && !ignoreErrors
    992                         cdl_warning( "ASP1006 cell $1: handler type $2 which might raise an error was inferred for the normal notificaton handler, but an error notification handler was not specified.",
     1096                        cdl_warning2( cell.get_locale, "NTF1006 cell $1: handler type $2 which might raise an error was inferred for the normal notificaton handler, but an error notification handler was not specified.",
    9931097                                cell.get_name, handler_flag)
    9941098                end
     
    10571161                        # $id$等の置換
    10581162                        cell.get_celltype.subst_name(subst, name_array)
    1059         }
    1060 
    1061         # 出力
    1062         kernelCfg.puts text
    1063 
    1064     end
    1065     private :gen_factory_for_cell
     1163      }
     1164
     1165     # 出力 (CRE_xxx)
     1166     kernelCfg.print pre_text
     1167     kernelCfg.print indent, text, "\n"
     1168     gen_sac kernelCfg, cell, indent
     1169     kernelCfg.print post_text
     1170   end
     1171
     1172   def gen_sac file, cell, indent
     1173     domain_root = cell.get_region.get_domain_root
     1174     if domain_root.get_domain_type then
     1175       id = (cell.get_attr_initializer :id).to_s
     1176                 name_array = cell.get_celltype.get_name_array(cell)
     1177       case cell.get_celltype.get_name
     1178       when :tCyclicNotifier
     1179         obj_type = "CYC"
     1180       when :tAlarmNotifier
     1181         obj_type = "ALM"
     1182       else
     1183         raise "NotifierPlugin: unknown celltype #{cell.get_celltype.get_name}"
     1184       end
     1185       id = cell.get_celltype.subst_name(id, name_array)
     1186       # p obj_type
     1187       # p HRPPlugin.get_sac_str cell
     1188       file.print indent, "SAC_#{obj_type}( #{id}, #{HRPPlugin.get_sac_str cell} );\n"
     1189     end
     1190   end
     1191   private :gen_factory_for_cell
    10661192
    10671193end
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/OpaqueRPCPlugin.rb

    r337 r374  
    5656  #=== RPCPlugin の initialize
    5757  #  説明は ThroughPlugin (plugin.rb) を参照
    58   def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
     58  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
    5959    super
    6060    @b_noClientSemaphore = false
     
    254254    nest = @end_region.gen_region_str_pre file
    255255    nest_str = "  " * nest
     256    if @next_cell_port_subscript then
     257      subscript = '[' + @next_cell_port_subscript.to_s + ']'
     258    else
     259      subscript = ""
     260    end
    256261
    257262    if @serverErrorHandler then
     
    282287#{nest_str}  cell #{@rpc_server_channel_celltype_name} #{@serverChannelCell}_Unmarshaler {
    283288#{nest_str}    cChannel = #{@serverChannelCell}.eC1;
    284 #{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name};
     289#{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
    285290#{serverErrorHandler_str}#{nest_str}  };
    286291EOT
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/RPCPlugin.rb

    r337 r374  
    6565  #=== RPCPlugin の initialize
    6666  #  説明は ThroughPlugin (plugin.rb) を参照
    67   def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
     67  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
    6868    super
    6969    @b_noClientSemaphore = false
     
    197197    nest = @region.gen_region_str_pre file
    198198    indent_str = "  " * nest
     199    if @next_cell_port_subscript then
     200      subscript = '[' + @next_cell_port_subscript.to_s + ']'
     201    else
     202      subscript = ""
     203    end
    199204
    200205    file.print <<EOT
     
    233238    file.print <<EOT
    234239#{indent_str}cell #{@rpc_channel_celltype_name} #{@cell_name} {
    235 #{indent_str}  #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name};
     240#{indent_str}  #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name}#{subscript};
    236241#{indent_str}  cTDR         = #{@channelCellName}.eTDR;
    237242#{indent_str}  cEventflag   = #{@channelCellName}.eEventflag;
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedOpaqueRPCPlugin.rb

    r337 r374  
    6868  #=== RPCPlugin の initialize
    6969  #  説明は ThroughPlugin (plugin.rb) を参照
    70   def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
     70  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
    7171    super
    7272    initialize_opaque_marshaler
     
    221221    nest = @start_region.gen_region_str_pre file
    222222    indent_str = "  " * nest
     223    nest_str = "  " * nest
     224    if @next_cell_port_subscript then
     225      subscript = '[' + @next_cell_port_subscript.to_s + ']'
     226    else
     227      subscript = ""
     228    end
    223229
    224230    # セルを探す
     
    303309#{indent_str}cell #{@unmarshaler_celltype_name} #{@cell_name}_Server {
    304310#{indent_str}  cTDR         = #{@shared_channel_cell}_Server.eTDR;
    305 #{indent_str}  cServerCall  = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name};
     311#{indent_str}  cServerCall  = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
    306312#{ppallocator_join}#{indent_str}};
    307313EOT
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedRPCPlugin.rb

    r337 r374  
    6262  #=== RPCPlugin の initialize
    6363  #  説明は ThroughPlugin (plugin.rb) を参照
    64   def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
     64  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
    6565
    6666    # mikan プラグインオプション指定の不一致のチェック task_priority,
     
    236236    nest = @region.gen_region_str_pre file
    237237    indent_str = "  " * nest
     238    if @next_cell_port_subscript then
     239      subscript = '[' + @next_cell_port_subscript.to_s + ']'
     240    else
     241      subscript = ""
     242    end
    238243
    239244    # セルを探す
     
    291296    file.print <<EOT
    292297#{indent_str}cell #{@rpc_channel_celltype_name} #{@cell_name} {
    293 #{indent_str}  #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name};
     298#{indent_str}  #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name}#{subscript};
    294299#{indent_str}  cTDR         = #{@shared_channel_cell}.eTDR;
    295300#{indent_str}  cEventflag   = #{@shared_channel_cell}.eEventflag;
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ThroughPlugin.rb

    r337 r374  
    4747#@next_cell:: Cell                    呼び口を結合するセル
    4848#@next_cell_port_name:: Symbol       呼び口を結合する受口の名前
     49#@next_cell_port_subscript::Nil|Integer   呼び口を結合する受口の配列添数.受け口配列でない場合 nil
    4950#@signature::      Signature          シグニチャ
    5051#@celltype::       Celltype           呼び先のセルのセルタイプ. through が連接する場合、最終的な呼び先のセルのセルタイプ
     
    7475  #next_cell::      Cell               呼び口を接続するセル
    7576  #next_cell_port_name:: Symbol        呼び口を接続する受口の名前
     77  #next_cell_port_subscript:: Nil|Integer  呼び口を接続する受口配列添数
    7678  #signature::      Signature          シグニチャ
    7779  #celltype::       Celltype           セルタイプ (呼び先のセルのセルタイプ)
    7880  #caller_cell::    Cell               呼び元のセル.@caller_cell の項を参照
    79   def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
     81  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
    8082    super()
    8183    @cell_name = cell_name                      # 生成すべきセル名(受け口側のセル名)
     
    8385    @next_cell = next_cell                      # 呼び先のセル
    8486    @next_cell_port_name = next_cell_port_name
     87    @next_cell_port_subscript = next_cell_port_subscript
    8588    @signature = signature
    8689    @entry_port_name = :"eThroughEntry"
     
    136139  def get_through_entry_port_name
    137140    @entry_port_name
     141  end
     142
     143  #===  生成されたセルの受け口配列添数を得る
     144  def get_through_entry_port_subscript
     145    @entry_port_subscript
    138146  end
    139147
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/TracePlugin.rb

    r337 r374  
    4444  #=== TracePlugin の initialize
    4545  #  説明は ThroughPlugin (plugin.rb) を参照
    46   def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
     46  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
    4747
    4848    @maxArrayDisplay = 16
     
    141141      nest = @region.gen_region_str_pre file
    142142      indent_str =  "  " * nest
     143      if @next_cell_port_subscript then
     144        subscript = '[' + @next_cell_port_subscript.to_s + ']'
     145      else
     146        subscript = ""
     147      end
    143148
    144149      if @probeName then
     
    155160      file.print <<EOT
    156161#{indent_str}cell #{@ct_name} #{@cell_name} {
    157 #{indent_str}  #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name};
     162#{indent_str}  #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
    158163#{probeName_str}#{caller_cell_str}#{indent_str}};
    159164EOT
     
    210215    }
    211216    file.print( " );\n" )
     217    if @next_cell_port_subscript then
     218      subscript = '[' + @next_cell_port_subscript.to_s + ']'
     219    else
     220      subscript = ""
     221    end
    212222
    213223    file.print <<EOT
    214224\tgetMicroTime( &utime );
    215 \tsyslog( LOG_INFO, \"Leave: %sTime=%d: #{@next_cell.get_name}.#{@next_cell_port_name}.#{func_name}\", ATTR_probeName_str, utime );
     225\tsyslog( LOG_INFO, \"Leave: %sTime=%d: #{@next_cell.get_name}.#{@next_cell_port_name}#{subscript}.#{func_name}\", ATTR_probeName_str, utime );
    216226EOT
    217227
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenHRP2Marshaler.rb

    r337 r374  
    3535#   の責任を負わない.
    3636
     37#   $Id$
    3738#++
    3839
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenOpaqueMarshaler.rb

    r337 r374  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2014 by TOPPERS Project
     6#   Copyright (C) 2008-2018 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    464464        /* Channel Lock */
    465465        SET_RPC_STATE( state_, RPCSTATE_CLIENT_GET_SEM );
    466         if( is_cLockChannel_joined() )
    467                 cLockChannel_wait();
     466        if( is_cLockChannel_joined() ){
     467                if( (ercd_=cLockChannel_wait()) != E_OK )
     468                        goto error_reset;
     469        }
    468470EOT
    469471
     
    554556        /* Channel Unlock */
    555557        SET_RPC_STATE( state_, RPCSTATE_CLIENT_RELEASE_SEM );
    556         if( is_cLockChannel_joined() )
    557                 cLockChannel_signal();
     558        if( is_cLockChannel_joined() ){
     559                if( (ercd_=cLockChannel_signal()) != E_OK )
     560                        goto error_reset;
     561        }
     562EOT
     563
     564    file.print <<EOT
     565        /* state_ is not used in normal case */
     566  /* below is to avoid 'set but not used' warnning */
     567        (void)state_;
    558568EOT
    559569
     
    630640        file.print <<EOT
    631641        }else{
    632                 return;
     642                return E_ID;
    633643        }
    634644EOT
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenTransparentMarshaler.rb

    r337 r374  
    388388    };
    389389#{ppallocator_dealloc_str}
    390     return;
     390    return E_OK;
    391391
    392392error_reset:
     
    394394        (void)cTDR_reset();
    395395#{ppallocator_dealloc_str}
     396    return E_OK;
    396397EOT
    397398
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/version.rb

    r337 r374  
    11$package = "tecsgen"
    2 $version = "1.5.0"
     2$version = "1.6.4"
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/netdev/if_btusb/Makefile.tinet

    r337 r374  
    4242INCLUDES        := $(INCLUDES) -I$(TINET_ROOT)/netdev/$(NET_DEV)
    4343TINET_DIRS      := $(TINET_DIRS):$(TINET_ROOT)/netdev/$(NET_DEV)
    44 TINET_COBJS     := $(TINET_COBJS) nap_main.o panu_main.o if_btusb.o
     44TINET_COBJS     := $(TINET_COBJS) bt_main.o if_btusb.o
    4545TINET_KERNEL_CFG := $(TINET_KERNEL_CFG) $(TINET_ROOT)/netdev/$(NET_DEV)/if_btusb.cfg
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/netdev/if_btusb/bt_main.c

    r373 r374  
    5858#include "sdp.h"
    5959#include "pan.h"
    60 #include "panu_main.h"
     60#include "bt_main.h"
     61#include "usb_hbth.h"
    6162
    6263//#define PACKET_DUMP
     
    6667
    6768#define RFCOMM_SERVER_CHANNEL 1
    68 /*static*/ uint16_t  rfcomm_channel_id = FAILED_RFCOMM_ID_NOT_SET;
     69static uint16_t  rfcomm_channel_id = FAILED_RFCOMM_ID_NOT_SET;
    6970
    7071static int record_id = -1;
     
    9091
    9192volatile int bt_bnep_mode = 0;
    92 bool_t bt_enabled = false;
     93
     94enum bt_state_t {
     95        BT_STATE_DORMANT,
     96        BT_STATE_POWER_ON,
     97        BT_STATE_BNEP_QUERY,
     98        BT_STATE_BNEP_WAIT,
     99        BT_STATE_BNEP_QUERY_WAIT,
     100        BT_STATE_CONNECTING,
     101        BT_STATE_CONNECTED,
     102};
     103
     104enum bt_state_t bt_state = BT_STATE_DORMANT;
     105int bt_timer;
    93106
    94107// outgoing network packet
     
    108121                break;
    109122        case DE_SIZE_VAR_16:
    110                 len = READ_NET_16(element, 1);
     123                len = big_endian_read_16(element, 1);
    111124                break;
    112125        default:
     
    129142
    130143        // accept first entry or if we foudn a NAP and only have a PANU yet
    131         if ((bnep_remote_uuid == 0) || (sdp_bnep_remote_uuid == BNEP_UUID_NAP && bnep_remote_uuid == BNEP_UUID_PANU)) {
     144        if ((bnep_remote_uuid == 0) || (sdp_bnep_remote_uuid == BLUETOOTH_SERVICE_CLASS_NAP && bnep_remote_uuid == BLUETOOTH_SERVICE_CLASS_PANU)) {
    132145                bnep_l2cap_psm = sdp_bnep_l2cap_psm;
    133146                bnep_remote_uuid = sdp_bnep_remote_uuid;
     
    146159
    147160        switch (event->type) {
    148         case SDP_QUERY_ATTRIBUTE_VALUE:
     161        case SDP_EVENT_QUERY_ATTRIBUTE_VALUE:
    149162                value_event = (sdp_query_attribute_value_event_t*)event;
    150163
     
    165178
    166179                                switch (value_event->attribute_id) {
    167                                 case SDP_ServiceClassIDList:
     180                                case BLUETOOTH_ATTRIBUTE_SERVICE_CLASS_ID_LIST:
    168181                                        if (de_get_element_type(attribute_value) != DE_DES) break;
    169182                                        for (des_iterator_init(&des_list_it, attribute_value); des_iterator_has_more(&des_list_it); des_iterator_next(&des_list_it)) {
     
    172185                                                uint32_t uuid = de_get_uuid32(element);
    173186                                                switch (uuid) {
    174                                                 case BNEP_UUID_PANU:
    175                                                 case BNEP_UUID_NAP:
    176                                                 case BNEP_UUID_GN:
     187                                                case BLUETOOTH_SERVICE_CLASS_PANU:
     188                                                case BLUETOOTH_SERVICE_CLASS_NAP:
     189                                                case BLUETOOTH_SERVICE_CLASS_GN:
    177190                                                        log_info("SDP Attribute 0x%04x: BNEP PAN protocol UUID: %04x", value_event->attribute_id, uuid);
    178191                                                        sdp_bnep_remote_uuid = uuid;
     
    192205                                        free(str);
    193206                                        break;
    194                                 case SDP_ProtocolDescriptorList: {
     207                                case BLUETOOTH_ATTRIBUTE_PROTOCOL_DESCRIPTOR_LIST: {
    195208                                        log_info("SDP Attribute: 0x%04x", value_event->attribute_id);
    196209
     
    210223                                                uuid = de_get_uuid32(element);
    211224                                                switch (uuid) {
    212                                                 case SDP_L2CAPProtocol:
     225                                                case BLUETOOTH_PROTOCOL_L2CAP:
    213226                                                        if (!des_iterator_has_more(&prot_it)) continue;
    214227                                                        des_iterator_next(&prot_it);
    215228                                                        de_element_get_uint16(des_iterator_get_element(&prot_it), &sdp_bnep_l2cap_psm);
    216229                                                        break;
    217                                                 case SDP_BNEPProtocol:
     230                                                case BLUETOOTH_PROTOCOL_BNEP:
    218231                                                        if (!des_iterator_has_more(&prot_it)) continue;
    219232                                                        des_iterator_next(&prot_it);
     
    238251                break;
    239252
    240         case SDP_QUERY_COMPLETE:
     253        case SDP_EVENT_QUERY_COMPLETE:
    241254                handle_sdp_client_record_complete();
    242255                complete_event = (sdp_query_complete_event_t*)event;
     
    246259                }
    247260                else {
     261                        bnep_do_connect = false;
    248262                        log_error("No BNEP service found");
     263                }
     264                if (!bnep_do_connect) {
     265                        // 20秒後 BNEP Query 開始
     266                        bt_state = BT_STATE_BNEP_QUERY_WAIT;
     267                        bt_timer = 20 * 1000;
    249268                }
    250269                break;
     
    269288                        if (packet[2] == HCI_STATE_WORKING) {
    270289                                hci_send_cmd(&hci_write_local_name, bt_localname);
    271                                 /* Send a general query for BNEP Protocol ID */
    272                                 log_info("Start SDP BNEP query.");
    273                                 sdp_general_query_for_uuid(remote_addr, SDP_BNEPProtocol);
     290                                if (bt_bnep_mode == 0) {
     291                                        // 即時 BNEP Query 開始
     292                                        bt_state = BT_STATE_BNEP_QUERY_WAIT;
     293                                        bt_timer = 0;
     294                                }
     295                                else {
     296                                        bt_state = BT_STATE_BNEP_WAIT;
     297                                        bt_timer = -1;
     298                                }
    274299                        }
    275300                        break;
     
    284309
    285310                case HCI_EVENT_COMMAND_COMPLETE:
    286                         if (COMMAND_COMPLETE_EVENT(packet, hci_read_bd_addr)) {
    287                                 bt_flip_addr(event_addr, &packet[6]);
     311                        if (HCI_EVENT_IS_COMMAND_COMPLETE(packet, hci_read_bd_addr)) {
     312                                reverse_bd_addr(&packet[6], event_addr);
    288313                                log_info("BD-ADDR: %s", bd_addr_to_str(event_addr));
    289314
     
    292317                                break;
    293318                        }
    294                         if (COMMAND_COMPLETE_EVENT(packet, hci_write_local_name)) {
    295                                 hci_discoverable_control(1);
     319                        if (HCI_EVENT_IS_COMMAND_COMPLETE(packet, hci_write_local_name)) {
     320                                gap_discoverable_control(1);
    296321                                break;
    297322                        }
     
    301326                        // deny link key request
    302327                        log_info("Link key request");
    303                         bt_flip_addr(event_addr, &packet[2]);
     328                        reverse_bd_addr(&packet[2], event_addr);
    304329                        hci_send_cmd(&hci_link_key_request_negative_reply, &event_addr);
    305330                        break;
     
    308333                        // inform about pin code request
    309334                        log_info("Pin code request - using '0000'");
    310                         bt_flip_addr(event_addr, &packet[2]);
     335                        reverse_bd_addr(&packet[2], event_addr);
    311336                        hci_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000");
    312337                        break;
     
    314339                case HCI_EVENT_USER_CONFIRMATION_REQUEST:
    315340                        // inform about user confirmation request
    316                         log_info("HCI User Confirmation Request with numeric value '%06u'", READ_BT_32(packet, 8));
     341                        log_info("HCI User Confirmation Request with numeric value '%06u'", little_endian_read_32(packet, 8));
    317342                        log_info("HCI User Confirmation Auto accept");
    318343                        break;
     
    320345                case RFCOMM_EVENT_INCOMING_CONNECTION:
    321346                        // data: event (8), len(8), address(48), channel (8), rfcomm_cid (16)
    322                         bt_flip_addr(event_addr, &packet[2]);
     347                        reverse_bd_addr(&packet[2], event_addr);
    323348                        rfcomm_channel_nr = packet[8];
    324                         rfcomm_channel_id = READ_BT_16(packet, 9);
     349                        rfcomm_channel_id = little_endian_read_16(packet, 9);
    325350                        log_info("RFCOMM channel %u requested for %s", rfcomm_channel_nr, bd_addr_to_str(event_addr));
    326351                        rfcomm_accept_connection_internal(rfcomm_channel_id);
     
    333358                        }
    334359                        else {
    335                                 rfcomm_channel_id = READ_BT_16(packet, 12);
    336                                 mtu = READ_BT_16(packet, 14);
     360                                rfcomm_channel_id = little_endian_read_16(packet, 12);
     361                                mtu = little_endian_read_16(packet, 14);
    337362                                log_info("RFCOMM channel open succeeded. New RFCOMM Channel ID %u, max frame size %u", rfcomm_channel_id, mtu);
    338363                        }
     
    347372                        if (packet[2]) {
    348373                                log_info("BNEP channel open failed, status %02x", packet[2]);
     374
     375                                // 30秒後 BNEP Query 開始
     376                                bt_state = BT_STATE_BNEP_QUERY_WAIT;
     377                                bt_timer = 30 * 1000;
    349378                        }
    350379                        else {
    351380                                // data: event(8), len(8), status (8), bnep source uuid (16), bnep destination uuid (16), remote_address (48)
    352                                 bnep_cid = READ_BT_16(packet, 3);
    353                                 uuid_source = READ_BT_16(packet, 5);
    354                                 uuid_dest = READ_BT_16(packet, 7);
    355                                 mtu = READ_BT_16(packet, 9);
    356                                 //bt_flip_addr(remote_addr, &packet[11]);
     381                                bnep_cid = little_endian_read_16(packet, 3);
     382                                uuid_source = little_endian_read_16(packet, 5);
     383                                uuid_dest = little_endian_read_16(packet, 7);
     384                                mtu = little_endian_read_16(packet, 9);
     385                                //reverse_bd_addr(&packet[11], remote_addr);
    357386                                memcpy(&remote_addr, &packet[11], sizeof(bd_addr_t));
    358387                                log_info("BNEP connection open succeeded to %s source UUID 0x%04x dest UUID: 0x%04x, max frame size %u", bd_addr_to_str(event_addr), uuid_source, uuid_dest, mtu);
     
    360389                                btstack_network_up(bnep_cid, (uint8_t *)hci_local_bd_addr(), (uint8_t *)remote_addr);
    361390                                log_info("Network Interface %s activated", btstack_network_get_name(bnep_cid));
     391
     392                                bt_state = BT_STATE_CONNECTED;
     393                                bt_timer = -1;
    362394                        }
    363395                        break;
     
    368400
    369401                case BNEP_EVENT_CHANNEL_CLOSED:
    370                         bnep_cid = READ_BT_16(packet, 2);
     402                        bnep_cid = little_endian_read_16(packet, 2);
    371403                        bt_channel_closed(bnep_cid);
     404
     405                        // 30秒後 BNEP Query 開始
     406                        bt_state = BT_STATE_BNEP_QUERY_WAIT;
     407                        bt_timer = 30 * 1000;
    372408                        break;
    373409
    374410                case BNEP_EVENT_READY_TO_SEND:
    375                         bnep_cid = READ_BT_16(packet, 2);
     411                        bnep_cid = little_endian_read_16(packet, 2);
    376412                        bt_send_packet(bnep_cid);
    377413                        break;
     
    428464}
    429465
    430 void panu_init(void)
     466void bt_init(void)
    431467{
    432468        const hci_transport_t *transport;
     
    437473        service_record_item_t *bnep_service_record_item;
    438474
     475        btstack_network_init(&network_send_packet_callback);
     476
    439477        //hci_dump_open("", HCI_DUMP_PACKETLOGGER);
    440 
    441         log_info("bt初期化...");
    442478
    443479        // start with BTstack init - especially configure HCI Transport
     
    446482
    447483        /* Initialize HCI */
    448         log_info("HCI初期化...");
    449484        transport = hci_transport_usb_instance();
    450485        control = NULL;
     
    455490
    456491        /* Initialize L2CAP */
    457         log_info("L2CAP初期化...");
    458492        l2cap_init();
    459493        l2cap_register_packet_handler(packet_handler);
    460494
    461495        /* Initialise SDP, create record for SPP and register with SDP */
    462         log_info("SDP初期化...");
    463496        sdp_init();
    464497
    465498        /* Initialize RFCOMM */
    466         log_info("RFCOMM初期化...");
    467499        rfcomm_init();
    468500        rfcomm_register_packet_handler(packet_handler);
     
    470502
    471503        /* Initialise BNEP */
    472         log_info("BNEP初期化...");
    473504        bnep_init();
    474505        bnep_register_packet_handler(packet_handler);
    475         bnep_register_service(NULL, BNEP_UUID_PANU, BNEP_MTU_MIN);  /* Minimum L2CAP MTU for bnep is 1691 bytes */
     506        if (bt_bnep_mode == 0) {
     507                bnep_register_service(NULL, BLUETOOTH_SERVICE_CLASS_PANU, BNEP_MTU_MIN);  /* Minimum L2CAP MTU for bnep is 1691 bytes */
     508        }
     509        else {
     510                bnep_register_service(NULL, BLUETOOTH_SERVICE_CLASS_NAP, BNEP_MTU_MIN);  /* Minimum L2CAP MTU for bnep is 1691 bytes */
     511        }
    476512
    477513        memset(spp_service_buffer, 0, sizeof(spp_service_buffer));
     
    482518        bnep_service_record_item = (service_record_item_t *)bnep_service_buffer;
    483519
    484         log_info("SPPサービス登録...");
    485520        sdp_create_spp_service((uint8_t*)&spp_service_record_item->service_record, 1, "RX SPP");
    486521        de_dump_data_element((uint8_t*)spp_service_record_item->service_record);
     
    488523        sdp_register_service_internal(NULL, spp_service_record_item);
    489524
    490         log_info("BNEPサービス登録...");
    491         pan_create_panu_service((uint8_t*)&bnep_service_record_item->service_record, "RX PANU", "RX PANU", BNEP_SECURITY_NONE);
    492         de_dump_data_element((uint8_t*)bnep_service_record_item->service_record);
    493         log_info("PANU SDP service buffer size: %u", (uint16_t)(sizeof(service_record_item_t) + de_get_len((uint8_t*)bnep_service_record_item->service_record)));
     525        if (bt_bnep_mode == 0) {
     526                pan_create_panu_service((uint8_t*)&bnep_service_record_item->service_record, "RX PANU", "RX PANU", BNEP_SECURITY_NONE);
     527                de_dump_data_element((uint8_t*)bnep_service_record_item->service_record);
     528                log_info("PANU SDP service buffer size: %u", (uint16_t)(sizeof(service_record_item_t) + de_get_len((uint8_t*)bnep_service_record_item->service_record)));
     529        }
     530        else {
     531                pan_create_nap_service((uint8_t*)&bnep_service_record_item->service_record, "RX NAP", "RX NAP", BNEP_SECURITY_NONE,
     532                        PAN_NET_ACCESS_TYPE_100MB_ETHERNET, 0x0001312D0/*10Mb/sec*/, NULL, NULL);
     533                de_dump_data_element((uint8_t*)bnep_service_record_item->service_record);
     534                log_info("NAP SDP service buffer size: %u", (uint16_t)(sizeof(service_record_item_t) + de_get_len((uint8_t*)bnep_service_record_item->service_record)));
     535        }
    494536        sdp_register_service_internal(NULL, bnep_service_record_item);
    495537
     
    500542
    501543        /* Turn on the device */
    502         log_info("HCI電源ON...");
    503544        hci_power_control(HCI_POWER_ON);
    504545
     
    506547        sdp_parser_init();
    507548        sdp_parser_register_callback(handle_sdp_client_query_result);
    508 }
    509 
    510 void nap_init(void);
    511 
    512 void bt_init(void)
    513 {
    514         btstack_network_init(&network_send_packet_callback);
    515 
    516         if (bt_bnep_mode == 0) {
    517                 panu_init();
    518         }
    519         else {
    520                 nap_init();
    521         }
    522 
    523         bt_enabled = true;
    524 }
    525 
    526 void bt_task(void)
    527 {
    528         extern void hal_tick_handler();
    529 
    530         if (bt_enabled) {
    531                 hal_tick_handler();
     549
     550        bt_state = BT_STATE_POWER_ON;
     551        bt_timer = -1;
     552}
     553
     554void bt_process(void)
     555{
     556        if (bt_state != BT_STATE_DORMANT) {
    532557                run_loop_execute();
    533558                bt_send_packet(0xffff);
     559        }
     560
     561        if (bt_timer != 0)
     562                return;
     563
     564        switch (bt_state) {
     565        case BT_STATE_BNEP_QUERY_WAIT:
     566                /* Send a general query for BNEP Protocol ID */
     567                log_info("Start SDP BNEP query.");
     568                sdp_general_query_for_uuid(remote_addr, BLUETOOTH_PROTOCOL_BNEP);
     569
     570                bt_state = BT_STATE_BNEP_QUERY;
     571                bt_timer = -1;
     572                break;
     573        default:
     574                bt_timer = -1;
     575                break;
    534576        }
    535577}
     
    592634        hci_close();
    593635
    594         bt_enabled = false;
    595 }
     636        bt_state = BT_STATE_DORMANT;
     637        bt_timer = -1;
     638}
     639
     640void bt_task_on_start(struct task_if_t *task, ID tskid)
     641{
     642}
     643
     644void bt_task_on_end(struct task_if_t *task)
     645{
     646}
     647
     648int bt_task_get_timer(struct task_if_t *task)
     649{
     650        return bt_timer;
     651}
     652
     653void bt_task_progress(struct task_if_t *task, int elapse)
     654{
     655        if (bt_timer == -1)
     656                return;
     657
     658        bt_timer -= elapse;
     659        if (bt_timer < 0)
     660                bt_timer = 0;
     661}
     662
     663void bt_task_process(struct task_if_t *task, enum task_event_t event)
     664{
     665        extern void hal_tick_handler();
     666
     667        switch (event & ~TASK_EVENT_TICK) {
     668        case TASK_EVENT_START:
     669                bt_init();
     670                break;
     671        case TASK_EVENT_TERMINATE:
     672                bt_terminate();
     673                break;
     674        case TASK_EVENT_WAKEUP:
     675        case TASK_EVENT_TIMEOUT:
     676                if (event & TASK_EVENT_TICK)
     677                        hal_tick_handler();
     678                bt_process();
     679                break;
     680        }
     681}
     682
     683struct task_if_t bt_task = {
     684        bt_task_on_start,
     685        bt_task_on_end,
     686        bt_task_get_timer,
     687        bt_task_progress,
     688        bt_task_process,
     689};
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/netdev/if_btusb/bt_main.h

    r373 r374  
    11/*
    2  * panu_main.h
     2 * bt_main.h
    33 *
    44 */
     
    1616
    1717void bt_init(void);
    18 void bt_task(void);
    1918int bt_can_send_packet(void);
    2019void bt_send_packet(uint16_t bnep_cid);
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/netdev/if_btusb/if_btusb.c

    r364 r374  
    7979#include "kernel/kernel_impl.h"
    8080#include "btstack/utils.h"
    81 #include "panu_main.h"
     81#include "bt_main.h"
    8282#include "usb_hbth.h"
    8383//#include "hal_cpu.h"
Note: See TracChangeset for help on using the changeset viewer.