Changeset 374 for asp3_tinet_ecnl_rx/trunk/asp3_dcre
- Timestamp:
- Apr 5, 2019, 9:26:53 PM (5 years ago)
- 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 153 153 154 154 # 155 # mbedサービスの定義 156 # 157 158 include $(SRCDIR)/mbed/Makefile.mbed 159 160 # 155 161 # 共通コンパイルオプションの定義 156 162 # -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/DebugCitrus/Makefile
r364 r374 153 153 154 154 # 155 # mbedサービスの定義 156 # 157 158 include $(SRCDIR)/mbed/Makefile.mbed 159 160 # 155 161 # 共通コンパイルオプションの定義 156 162 # -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/arch/rx630_gcc/tSCIF.c
r337 r374 47 47 #include "tSCIF_tecsgen.h" 48 48 #include "scif.h" 49 #include "target_kernel_impl.h" 49 50 50 51 /* -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/cfg/pass1.rb
r337 r374 727 727 # 728 728 def self.OutLineNumber(cfgInfo) 729 @cfg1Out.add("#line #{cfgInfo[:_LINE_]} \"#{cfgInfo[:_FILE_] }\"")729 @cfg1Out.add("#line #{cfgInfo[:_LINE_]} \"#{cfgInfo[:_FILE_].gsub('\\', '/')}\"") 730 730 end 731 731 … … 734 734 # 735 735 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('\\', '/')}\"") 737 737 end 738 738 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/gdic/adafruit_ssd1306/adafruit_ssd1306.h
r364 r374 22 22 #include <stdbool.h> 23 23 #include <time.h> 24 #include "mbed_api.h" 24 #include "gpio_api.h" 25 #include "spi_api.h" 26 #include "i2c_api.h" 25 27 #include "gfxfont.h" 26 28 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/Makefile.target
r337 r374 13 13 # コンパイルオプション 14 14 # 15 INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/ pdic15 INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/mbed 16 16 17 17 # … … 25 25 # システムサービスに関する定義 26 26 # 27 SYSSVC_DIRS := $(SYSSVC_DIRS) 27 SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/mbed 28 28 SYSSVC_COBJS := $(SYSSVC_COBJS) 29 29 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/gr_citrus.h
r337 r374 71 71 * ボーレート設定 72 72 */ 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 79 74 80 75 /* -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/tSIOPortGRCitrus.cdl
r337 r374 51 51 */ 52 52 import_C("gr_citrus.h"); 53 import_C(" rx630.h");53 import_C("device.h"); 54 54 55 55 /* 56 56 * FIFO内蔵シリアルコミュニケーションインタフェース用 簡易SIOドライバ 57 57 */ 58 import("t SCIF.cdl");58 import("tMbedSerial.cdl"); 59 59 60 60 /* … … 74 74 call sSIOPort cSIOPort; 75 75 [inline] entry siSIOCBR eiSIOCBR; 76 77 /*78 * 割込み要求ライン操作のための結合79 */80 call sInterruptRequest cRxInterruptRequest;81 call sInterruptRequest cTxInterruptRequest;82 76 }; 83 77 … … 86 80 * ト)のセルタイプ 87 81 */ 88 [active]89 82 composite tSIOPortGRCitrus { 90 83 /* … … 98 91 */ 99 92 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 */ 105 95 uint32_t baudRate = 115200; /* ボーレートの設定値 */ 106 96 }; … … 109 99 * SIOドライバ 110 100 */ 111 cell tSCIF SCIF { 112 baseAddress = composite.baseAddress; 101 cell tMbedSerial MbedSerial { 102 tx = composite.tx; 103 rx = composite.rx; 113 104 baudRate = composite.baudRate; 114 105 ciSIOCBR = SIOPortMain.eiSIOCBR; … … 120 111 cell tSIOPortGRCitrusMain SIOPortMain { 121 112 ciSIOCBR => composite.ciSIOCBR; 122 cSIOPort = SCIF.eSIOPort; 123 cRxInterruptRequest = RxInterruptRequest.eInterruptRequest; 124 cTxInterruptRequest = TxInterruptRequest.eInterruptRequest; 113 cSIOPort = MbedSerial.eSIOPort; 125 114 }; 126 115 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 };153 116 }; 154 117 … … 158 121 * サンプルプログラムが使うポートが,SIOPortTarget1に固定されているた 159 122 * め,ポート1とポート3を入れ換えている.具体的には,SIOPortTarget1は 160 * SCIFのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,161 * SIOPortTarget3は SCIFのチャネル0につながっている.123 * MbedSerialのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に, 124 * SIOPortTarget3はMbedSerialのチャネル0につながっている. 162 125 */ 163 126 [prototype] 164 127 cell tSIOPortGRCitrus SIOPortTarget1 { 165 128 /* 属性の設定 */ 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 */ 169 131 }; 170 132 … … 172 134 cell tSIOPortGRCitrus SIOPortTarget2 { 173 135 /* 属性の設定 */ 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 */ 177 138 }; 178 139 … … 180 141 cell tSIOPortGRCitrus SIOPortTarget3 { 181 142 /* 属性の設定 */ 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 */ 185 145 }; 186 146 … … 188 148 cell tSIOPortGRCitrus SIOPortTarget4 { 189 149 /* 属性の設定 */ 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 */ 193 152 }; 194 153 … … 196 155 cell tSIOPortGRCitrus SIOPortTarget5 { 197 156 /* 属性の設定 */ 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 */ 201 159 }; 202 160 … … 204 162 cell tSIOPortGRCitrus SIOPortTarget6 { 205 163 /* 属性の設定 */ 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 */ 209 166 }; 210 167 … … 212 169 cell tSIOPortGRCitrus SIOPortTarget7 { 213 170 /* 属性の設定 */ 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 */ 217 173 }; 218 174 … … 220 176 cell tSIOPortGRCitrus SIOPortTarget8 { 221 177 /* 属性の設定 */ 222 baseAddress = NULL; 223 rxInterruptNumber = NULL; 224 txInterruptNumber = NULL; 178 rx = NULL; 179 tx = NULL; 225 180 }; -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/tSIOPortGRCitrusMain_inline.h
r337 r374 57 57 */ 58 58 cSIOPort_open(); 59 60 /*61 * SIOの割込みマスクを解除する.62 */63 cRxInterruptRequest_enable();64 cTxInterruptRequest_enable();65 59 } 66 60 … … 77 71 */ 78 72 cSIOPort_close(); 79 80 /*81 * SIOの割込みをマスクする.82 */83 cRxInterruptRequest_disable();84 cTxInterruptRequest_disable();85 73 } 86 74 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_kernel_impl.c
r364 r374 53 53 #include "syssvc/serial.h" 54 54 #ifdef TOPPERS_OMIT_TECS 55 #include "rx630_uart.h" 55 #include "serial_api.h" 56 #endif 57 58 #ifdef TOPPERS_OMIT_TECS 59 serial_t log_serial; 56 60 #endif 57 61 … … 75 79 sil_reb_mem(PORTA_PDR_ADDR) & ~PORT_PDR_B7_BIT); 76 80 81 #ifdef TOPPERS_OMIT_TECS 77 82 /* 78 83 * シリアルポートの設定 79 84 */ 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 91 89 92 90 /* ポートP40~P47を周辺機器に */ … … 149 147 { 150 148 if (c == '\n') { 151 rx630_uart_pol_putc('\r', TARGET_PUTC_PORTID);149 serial_putc(&log_serial, '\r'); 152 150 } 153 151 154 rx630_uart_pol_putc(c, TARGET_PUTC_PORTID);152 serial_putc(&log_serial, c); 155 153 } 156 154 #endif -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_serial.c
r337 r374 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 4 * Advanced Standard Profile Kernel 5 * 5 * 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN … … 12 12 * Copyright (C) 2008-2010 by Witz Corporation, JAPAN 13 13 * Copyright (C) 2013 by Mitsuhiro Matsuura 14 * 14 * 15 15 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 16 16 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 35 35 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 36 36 * 免責すること. 37 * 37 * 38 38 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 39 39 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 41 41 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 42 42 * の責任を負わない. 43 * 43 * 44 44 * @(#) $Id$ 45 45 */ … … 51 51 #include <sil.h> 52 52 #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 */ 60 typedef struct sio_port_initialization_block { 61 PinName tx; 62 PinName rx; 63 } SIOPINIB; 64 65 /* 66 * シリアルI/Oポート管理ブロックの定義 67 */ 68 struct 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 */ 78 SIOPCB siopcb_table[TNUM_PORT]; 79 80 static 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 110 static void mbed_serial_irq_handler(uint32_t id, SerialIrq event); 53 111 54 112 /* … … 58 116 sio_initialize(intptr_t exinf) 59 117 { 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 } 61 128 } 62 129 … … 69 136 SIOPCB *p_siopcb = NULL; 70 137 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; 98 157 } 99 158 … … 105 164 { 106 165 ER ercd; 107 INTNO intno_sio_tx, intno_sio_rx;166 serial_t *serial = &p_siopcb->serial; 108 167 109 168 /* 110 169 * デバイス依存のクローズ処理. 111 170 */ 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 */ 178 bool_t 179 sio_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 */ 191 int_t 192 sio_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 */ 203 void 204 sio_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 */ 220 void 221 sio_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 */ 237 void 238 serial_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 */ 247 void 248 serial_irdy_rcv(SIOPCB *p_siopcb) 249 { 250 /* 共通部(syssvc\serial.c)にあるsio_irdy_rcv関数を呼び出し*/ 251 sio_irdy_rcv(p_siopcb->exinf); 123 252 } 124 253 … … 126 255 * SIOの割込みハンドラ 127 256 */ 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 257 void 258 mbed_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 4 4 5 5 #include <target_serial.h> 6 6 7 ATT_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 });9 8 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 53 53 54 54 #include "gr_citrus.h" 55 #include " rx630_uart.h"55 #include "serial_api.h" 56 56 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 66 59 67 60 #ifndef TOPPERS_MACRO_ONLY 68 61 62 typedef struct sio_port_control_block SIOPCB; 69 63 70 64 /* … … 82 76 */ 83 77 extern 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);90 78 91 79 /* -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_syssvc.h
r337 r374 113 113 114 114 /* 115 * 使用するシリアルポートのPinName 116 */ 117 #define STDIO_UART_TX P20 118 #define STDIO_UART_RX P21 119 120 /* 115 121 * システムログタスク関連の定数の定義 116 122 * -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/Makefile.target
r337 r374 13 13 # コンパイルオプション 14 14 # 15 INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/ pdic15 INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/mbed 16 16 17 17 # … … 25 25 # システムサービスに関する定義 26 26 # 27 SYSSVC_DIRS := $(SYSSVC_DIRS) 27 SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/mbed 28 28 SYSSVC_COBJS := $(SYSSVC_COBJS) 29 29 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/gr_sakura.h
r337 r374 71 71 * ボーレート設定 72 72 */ 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 79 74 80 75 /* -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/tSIOPortGRSakura.cdl
r337 r374 51 51 */ 52 52 import_C("gr_sakura.h"); 53 import_C(" rx630.h");53 import_C("device.h"); 54 54 55 55 /* 56 56 * FIFO内蔵シリアルコミュニケーションインタフェース用 簡易SIOドライバ 57 57 */ 58 import("t SCIF.cdl");58 import("tMbedSerial.cdl"); 59 59 60 60 /* … … 74 74 call sSIOPort cSIOPort; 75 75 [inline] entry siSIOCBR eiSIOCBR; 76 77 /*78 * 割込み要求ライン操作のための結合79 */80 call sInterruptRequest cRxInterruptRequest;81 call sInterruptRequest cTxInterruptRequest;82 76 }; 83 77 … … 86 80 * ト)のセルタイプ 87 81 */ 88 [active]89 82 composite tSIOPortGRSakura { 90 83 /* … … 98 91 */ 99 92 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 */ 105 95 uint32_t baudRate = 115200; /* ボーレートの設定値 */ 106 96 }; … … 109 99 * SIOドライバ 110 100 */ 111 cell tSCIF SCIF { 112 baseAddress = composite.baseAddress; 101 cell tMbedSerial MbedSerial { 102 tx = composite.tx; 103 rx = composite.rx; 113 104 baudRate = composite.baudRate; 114 105 ciSIOCBR = SIOPortMain.eiSIOCBR; … … 120 111 cell tSIOPortGRSakuraMain SIOPortMain { 121 112 ciSIOCBR => composite.ciSIOCBR; 122 cSIOPort = SCIF.eSIOPort; 123 cRxInterruptRequest = RxInterruptRequest.eInterruptRequest; 124 cTxInterruptRequest = TxInterruptRequest.eInterruptRequest; 113 cSIOPort = MbedSerial.eSIOPort; 125 114 }; 126 115 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 };153 116 }; 154 117 … … 158 121 * サンプルプログラムが使うポートが,SIOPortTarget1に固定されているた 159 122 * め,ポート1とポート3を入れ換えている.具体的には,SIOPortTarget1は 160 * SCIFのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,161 * SIOPortTarget3は SCIFのチャネル0につながっている.123 * MbedSerialのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に, 124 * SIOPortTarget3はMbedSerialのチャネル0につながっている. 162 125 */ 163 126 [prototype] 164 127 cell tSIOPortGRSakura SIOPortTarget1 { 165 128 /* 属性の設定 */ 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 */ 169 131 }; 170 132 … … 172 134 cell tSIOPortGRSakura SIOPortTarget2 { 173 135 /* 属性の設定 */ 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 */ 177 138 }; 178 139 … … 180 141 cell tSIOPortGRSakura SIOPortTarget3 { 181 142 /* 属性の設定 */ 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 */ 185 145 }; 186 146 … … 188 148 cell tSIOPortGRSakura SIOPortTarget4 { 189 149 /* 属性の設定 */ 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 */ 193 152 }; 194 153 … … 196 155 cell tSIOPortGRSakura SIOPortTarget5 { 197 156 /* 属性の設定 */ 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 */ 201 159 }; 202 160 … … 204 162 cell tSIOPortGRSakura SIOPortTarget6 { 205 163 /* 属性の設定 */ 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 */ 209 166 }; 210 167 … … 212 169 cell tSIOPortGRSakura SIOPortTarget7 { 213 170 /* 属性の設定 */ 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 */ 217 173 }; 218 174 … … 220 176 cell tSIOPortGRSakura SIOPortTarget8 { 221 177 /* 属性の設定 */ 222 baseAddress = NULL; 223 rxInterruptNumber = NULL; 224 txInterruptNumber = NULL; 178 tx = NULL; 179 rx = NULL; 225 180 }; -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/tSIOPortGRSakuraMain_inline.h
r337 r374 57 57 */ 58 58 cSIOPort_open(); 59 60 /*61 * SIOの割込みマスクを解除する.62 */63 cRxInterruptRequest_enable();64 cTxInterruptRequest_enable();65 59 } 66 60 … … 77 71 */ 78 72 cSIOPort_close(); 79 80 /*81 * SIOの割込みをマスクする.82 */83 cRxInterruptRequest_disable();84 cTxInterruptRequest_disable();85 73 } 86 74 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_kernel_impl.c
r364 r374 53 53 #include "syssvc/serial.h" 54 54 #ifdef TOPPERS_OMIT_TECS 55 #include "rx630_uart.h" 55 #include "serial_api.h" 56 #endif 57 58 #ifdef TOPPERS_OMIT_TECS 59 serial_t log_serial; 56 60 #endif 57 61 … … 78 82 sil_reb_mem(PORTA_PDR_ADDR) & ~PORT_PDR_B7_BIT); 79 83 84 #ifdef TOPPERS_OMIT_TECS 80 85 /* 81 86 * シリアルポートの設定 82 87 */ 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 94 92 95 93 /* ポートP40~P47を周辺機器に */ … … 152 150 { 153 151 if (c == '\n') { 154 rx630_uart_pol_putc('\r', TARGET_PUTC_PORTID);152 serial_putc(&log_serial, '\r'); 155 153 } 156 154 157 rx630_uart_pol_putc(c, TARGET_PUTC_PORTID);155 serial_putc(&log_serial, c); 158 156 } 159 157 #endif -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_serial.c
r337 r374 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 4 * Advanced Standard Profile Kernel 5 * 5 * 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN … … 12 12 * Copyright (C) 2008-2010 by Witz Corporation, JAPAN 13 13 * Copyright (C) 2013 by Mitsuhiro Matsuura 14 * 14 * 15 15 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 16 16 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 35 35 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 36 36 * 免責すること. 37 * 37 * 38 38 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 39 39 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 41 41 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 42 42 * の責任を負わない. 43 * 43 * 44 44 * @(#) $Id$ 45 45 */ … … 51 51 #include <sil.h> 52 52 #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 */ 60 typedef struct sio_port_initialization_block { 61 PinName tx; 62 PinName rx; 63 } SIOPINIB; 64 65 /* 66 * シリアルI/Oポート管理ブロックの定義 67 */ 68 struct 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 */ 78 SIOPCB siopcb_table[TNUM_PORT]; 79 80 static 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 110 static void mbed_serial_irq_handler(uint32_t id, SerialIrq event); 53 111 54 112 /* … … 58 116 sio_initialize(intptr_t exinf) 59 117 { 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 } 61 128 } 62 129 … … 69 136 SIOPCB *p_siopcb = NULL; 70 137 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; 98 157 } 99 158 … … 105 164 { 106 165 ER ercd; 107 INTNO intno_sio_tx, intno_sio_rx;166 serial_t *serial = &p_siopcb->serial; 108 167 109 168 /* 110 169 * デバイス依存のクローズ処理. 111 170 */ 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 */ 178 bool_t 179 sio_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 */ 191 int_t 192 sio_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 */ 203 void 204 sio_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 */ 220 void 221 sio_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 */ 237 void 238 serial_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 */ 247 void 248 serial_irdy_rcv(SIOPCB *p_siopcb) 249 { 250 /* 共通部(syssvc\serial.c)にあるsio_irdy_rcv関数を呼び出し*/ 251 sio_irdy_rcv(p_siopcb->exinf); 123 252 } 124 253 … … 126 255 * SIOの割込みハンドラ 127 256 */ 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 257 void 258 mbed_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 4 4 5 5 #include <target_serial.h> 6 6 7 ATT_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 });9 8 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 53 53 54 54 #include "gr_sakura.h" 55 #include " rx630_uart.h"55 #include "serial_api.h" 56 56 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 66 59 67 60 #ifndef TOPPERS_MACRO_ONLY 68 61 62 typedef struct sio_port_control_block SIOPCB; 69 63 70 64 /* … … 82 76 */ 83 77 extern 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);90 78 91 79 /* -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_syssvc.h
r337 r374 113 113 114 114 /* 115 * 使用するシリアルポートのPinName 116 */ 117 #define STDIO_UART_TX P20 118 #define STDIO_UART_RX P21 119 120 /* 115 121 * システムログタスク関連の定数の定義 116 122 * -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/MANIFEST_tecsgen_body
r337 r374 1 1 MANIFEST_tecsgen_body 2 2 3 Makefile 3 4 tecscde 5 tecscde.rb 6 tecsgen 7 tecsgen.rb 8 tecsgen_rcov.rb 9 tecsmerge 10 tecsmerge.rb 4 11 cdelib/Makefile 5 12 cdelib/cell_plugin_dialog.rb … … 11 18 cdelib/tview.rb 12 19 cdelib/version.rb 13 14 20 tecs/TECSInfo/TECSInfo.cdl 21 tecs/TECSInfo/TECSInfoAccessor.cdl 15 22 tecs/TECSInfo/nTECSInfo_tArrayTypeInfo.c 16 tecs/TECSInfo/nTECSInfo_tAttrVarInfo.c17 23 tecs/TECSInfo/nTECSInfo_tBoolTypeInfo.c 18 24 tecs/TECSInfo/nTECSInfo_tCallInfo.c … … 28 34 tecs/TECSInfo/nTECSInfo_tParamInfo.c 29 35 tecs/TECSInfo/nTECSInfo_tPtrTypeInfo.c 36 tecs/TECSInfo/nTECSInfo_tRawEntryDescriptorInfo.c 30 37 tecs/TECSInfo/nTECSInfo_tRegionInfo.c 31 38 tecs/TECSInfo/nTECSInfo_tSignatureInfo.c 32 39 tecs/TECSInfo/nTECSInfo_tStructTypeInfo.c 40 tecs/TECSInfo/nTECSInfo_tTECSInfoAccessor.c 33 41 tecs/TECSInfo/nTECSInfo_tTECSInfoSub.c 34 42 tecs/TECSInfo/nTECSInfo_tTECSInfo_inline.h … … 36 44 tecs/TECSInfo/nTECSInfo_tVarDeclInfo.c 37 45 tecs/TECSInfo/nTECSInfo_tVoidTypeInfo.c 46 tecs/TECSInfo/tTECSInfoAccessor.c 38 47 tecs/TLSFMalloc/README-TLSF.txt 39 48 tecs/TLSFMalloc/tTLSFMalloc.cdl … … 61 70 tecs/mruby/nMruby_tMruby.c 62 71 tecs/mruby/nMruby_tMrubyCyclicTaskBody.c 72 tecs/mruby/nMruby_tMrubyProc.c 63 73 tecs/mruby/nMruby_tMrubyTaskBody.c 64 74 tecs/mruby/nMruby_tMrubyVM.c … … 87 97 tecs/rpc/tDataqueueAdaptor_inline.h 88 98 tecs/rpc/tDataqueueOWChannel.cdl 99 tecs/rpc/tMessageBufferCEP.cdl 100 tecs/rpc/tMessageBufferCEP_inline.h 101 tecs/rpc/tMessageBufferChannel.cdl 89 102 tecs/rpc/tNBOTDR_inline.h 90 103 tecs/rpc/tPPAllocator.c … … 105 118 tecs/tecs.h 106 119 tecs/tecs.xsd 107 108 tecscde109 tecscde.rb110 tecsgen111 tecsgen.rb112 tecsgen_rcov113 tecsgen_rcov.rb114 120 tecslib/core/C_parser.tab.rb 115 121 tecslib/core/C_parser.y.rb … … 132 138 tecslib/core/tool_info.rb 133 139 tecslib/core/types.rb 140 tecslib/core/unjoin_plugin.rb 134 141 tecslib/core/value.rb 135 142 tecslib/messages/messages_console_en_US.rb … … 165 172 tecslib/plugin/HRP2SemaphorePlugin.rb 166 173 tecslib/plugin/HRP2TaskPlugin.rb 174 tecslib/plugin/HRPHandlerPlugin.rb 175 tecslib/plugin/HRPKernelObjectManager.rb 176 tecslib/plugin/HRPKernelObjectPlugin.rb 177 tecslib/plugin/HRPObjectPlugin.rb 178 tecslib/plugin/HRPPlugin.rb 179 tecslib/plugin/HRPRPCPlugin.rb 180 tecslib/plugin/HRPSVCPlugin.rb 181 tecslib/plugin/HRPTaskPlugin.rb 167 182 tecslib/plugin/Mruby2CBridgePlugin.rb 168 183 tecslib/plugin/MrubyBridgeCellPlugin.rb 169 184 tecslib/plugin/MrubyBridgeCelltypePlugin.rb 185 tecslib/plugin/MrubyBridgeCompositePlugin.rb 170 186 tecslib/plugin/MrubyBridgePlugin.rb 171 187 tecslib/plugin/MrubyBridgeSignaturePlugin.rb … … 175 191 tecslib/plugin/OpaqueRPCPlugin.rb 176 192 tecslib/plugin/RPCPlugin.rb 193 tecslib/plugin/RepeatCellPlugin.rb 194 tecslib/plugin/RepeatJoinPlugin.rb 177 195 tecslib/plugin/SharedOpaqueRPCPlugin.rb 178 196 tecslib/plugin/SharedRPCPlugin.rb … … 186 204 tecslib/plugin/lib/GenParamCopy.rb 187 205 tecslib/plugin/lib/GenTransparentMarshaler.rb 206 tecslib/plugin/lib/MrubyBridgeCelltypePluginModule.rb 188 207 tecslib/version.rb 189 190 tecsmerge191 tecsmerge.rb -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecs/mruby/TECSPointer.h
r359 r374 102 102 { \ 103 103 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 ) \ 106 106 /* '=' unecessary for negative value */ \ 107 107 /* ignore warning on int32_t */ \ … … 126 126 { \ 127 127 if( sizeof( type ) > sizeof( mrb_int ) ){ \ 128 if( val >= (((type)1) << (sizeof(mrb_int)*8)))\128 if( val > TYPE ## _MAX ) \ 129 129 /* '=' unecessary for negative value */ \ 130 130 /* ignore warning on int32_t */ \ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyVMs.cdl
r359 r374 37 37 38 38 /* 39 * tools/mruby/mruby.c から cInit_initializeBridge( mrb ) を呼び出すように変更したもの 39 * POSIX 環境用の VM 40 * mrbgems の mrbgems/mruby-bin-mruby/tools/mruby/mruby.c を参考に作成したもの 40 41 */ 41 42 namespace nMruby{ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecs/mruby/tecs_mruby.h
r359 r374 1 1 /* 2 * Copyright (C) 2008-201 7by TOPPERS Project2 * Copyright (C) 2008-2019 by TOPPERS Project 3 3 * 4 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 46 46 #include "mruby/irep.h" 47 47 #include "mruby/dump.h" 48 #include "mruby/proc.h" 48 49 49 50 #include "TECSPointer.h" 50 51 #include "TECSStruct.h" 51 52 52 #if ! defined( MRUBY_RELEASE_MAJOR ) || MRUBY_RELEASE_MAJOR == 1 && MRUBY_RELEASE_MINOR < 253 #ifndef MRB_ARGS_REQ54 #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 #endif65 53 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 */ 71 55 72 56 /* 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. 74 58 * types: long long, long long int 75 59 * special keyword __attribute__(x), __extension__ … … 78 62 typedef int mrb_irep; 79 63 typedef int mrb_context; 80 struct RClass { int dummy;};81 struct RProc { int dummy;};64 struct RClass {uint32_t gcnext;}; // actual definition: struct RBasic *gcnext 65 struct RProc {uint32_t gcnext;}; // actual definition: struct RBasic *gcnext 82 66 83 67 typedef 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 ) 84 75 85 76 #endif /* TECSGEN */ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecs/rpc/TDR.cdl
r337 r374 68 68 ER sendSOP( [in]bool_t b_client ); /* StartOfPacket magic を送信 */ 69 69 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 を受信 */75 70 /* b_client: クライアント側なら true, サーバー側なら false */ 76 71 … … 150 145 }; 151 146 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) 153 148 celltype tTDR { 154 149 call sChannel cChannel; -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecs/rpc/sChannel.cdl
r337 r374 58 58 }; 59 59 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 75 75 return(E_ID); 76 76 } 77 (void)p_cellcb; // to avoid unused warning 77 78 78 79 syslog( LOG_INFO, "TDR: resetting channel" ); … … 102 103 return(E_ID); 103 104 } 105 (void)p_cellcb; // to avoid unused warning 104 106 105 107 /* ここに処理本体を記述します #_TEFB_# */ … … 151 153 return(E_ID); 152 154 } 155 (void)p_cellcb; // to avoid unused warning 153 156 154 157 /* ここに処理本体を記述します #_TEFB_# */ … … 157 160 #endif 158 161 159 162 if( b_client ) 160 163 p_sopMagic = &SOP_MAGIC2; 161 164 else … … 198 201 return(E_ID); 199 202 } 203 (void)p_cellcb; // to avoid unused warning 200 204 201 205 /* ここに処理本体を記述します #_TEFB_# */ … … 234 238 return(E_ID); 235 239 } 240 (void)p_cellcb; // to avoid unused warning 236 241 237 242 /* ここに処理本体を記述します #_TEFB_# */ … … 267 272 return(E_ID); 268 273 } 274 (void)p_cellcb; // to avoid unused warning 269 275 270 276 /* ここに処理本体を記述します #_TEFB_# */ … … 287 293 return(E_ID); 288 294 } 295 (void)p_cellcb; // to avoid unused warning 289 296 290 297 /* ここに処理本体を記述します #_TEFB_# */ … … 307 314 return(E_ID); 308 315 } 316 (void)p_cellcb; // to avoid unused warning 309 317 310 318 /* ここに処理本体を記述します #_TEFB_# */ … … 327 335 return(E_ID); 328 336 } 337 (void)p_cellcb; // to avoid unused warning 329 338 330 339 /* ここに処理本体を記述します #_TEFB_# */ … … 347 356 return(E_ID); 348 357 } 358 (void)p_cellcb; // to avoid unused warning 349 359 350 360 /* ここに処理本体を記述します #_TEFB_# */ … … 368 378 return(E_ID); 369 379 } 380 (void)p_cellcb; // to avoid unused warning 370 381 371 382 /* ここに処理本体を記述します #_TEFB_# */ … … 390 401 return(E_ID); 391 402 } 403 (void)p_cellcb; // to avoid unused warning 392 404 393 405 /* ここに処理本体を記述します #_TEFB_# */ … … 412 424 return(E_ID); 413 425 } 426 (void)p_cellcb; // to avoid unused warning 414 427 415 428 /* ここに処理本体を記述します #_TEFB_# */ … … 434 447 return(E_ID); 435 448 } 449 (void)p_cellcb; // to avoid unused warning 436 450 437 451 /* ここに処理本体を記述します #_TEFB_# */ … … 456 470 return(E_ID); 457 471 } 472 (void)p_cellcb; // to avoid unused warning 458 473 459 474 /* ここに処理本体を記述します #_TEFB_# */ … … 477 492 return(E_ID); 478 493 } /* end if VALID_IDX(idx) */ 494 (void)p_cellcb; // to avoid unused warning 479 495 480 496 /* ここに処理本体を記述します #_TEFB_# */ … … 497 513 return(E_ID); 498 514 } /* end if VALID_IDX(idx) */ 515 (void)p_cellcb; // to avoid unused warning 499 516 500 517 /* ここに処理本体を記述します #_TEFB_# */ … … 517 534 return(E_ID); 518 535 } /* end if VALID_IDX(idx) */ 536 (void)p_cellcb; // to avoid unused warning 519 537 520 538 /* ここに処理本体を記述します #_TEFB_# */ … … 537 555 return(E_ID); 538 556 } /* end if VALID_IDX(idx) */ 557 (void)p_cellcb; // to avoid unused warning 539 558 540 559 /* ここに処理本体を記述します #_TEFB_# */ … … 557 576 return(E_ID); 558 577 } /* end if VALID_IDX(idx) */ 578 (void)p_cellcb; // to avoid unused warning 559 579 560 580 /* ここに処理本体を記述します #_TEFB_# */ … … 578 598 return(E_ID); 579 599 } /* end if VALID_IDX(idx) */ 600 (void)p_cellcb; // to avoid unused warning 580 601 581 602 /* ここに処理本体を記述します #_TEFB_# */ … … 600 621 return(E_ID); 601 622 } /* end if VALID_IDX(idx) */ 623 (void)p_cellcb; // to avoid unused warning 602 624 603 625 /* ここに処理本体を記述します #_TEFB_# */ … … 622 644 return(E_ID); 623 645 } /* end if VALID_IDX(idx) */ 646 (void)p_cellcb; // to avoid unused warning 624 647 625 648 /* ここに処理本体を記述します #_TEFB_# */ … … 644 667 return(E_ID); 645 668 } /* end if VALID_IDX(idx) */ 669 (void)p_cellcb; // to avoid unused warning 646 670 647 671 /* ここに処理本体を記述します #_TEFB_# */ … … 666 690 return(E_ID); 667 691 } /* end if VALID_IDX(idx) */ 692 (void)p_cellcb; // to avoid unused warning 668 693 669 694 /* ここに処理本体を記述します #_TEFB_# */ … … 688 713 return(E_ID); 689 714 } /* end if VALID_IDX(idx) */ 715 (void)p_cellcb; // to avoid unused warning 690 716 691 717 /* ここに処理本体を記述します #_TEFB_# */ … … 705 731 ER ercd = E_OK; 706 732 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 714 741 715 742 /* ここに処理本体を記述します #_TEFB_# */ … … 737 764 return(E_ID); 738 765 } 766 (void)p_cellcb; // to avoid unused warning 739 767 740 768 /* ここに処理本体を記述します #_TEFB_# */ … … 757 785 return(E_ID); 758 786 } 787 (void)p_cellcb; // to avoid unused warning 759 788 760 789 /* ここに処理本体を記述します #_TEFB_# */ … … 778 807 return(E_ID); 779 808 } 809 (void)p_cellcb; // to avoid unused warning 780 810 781 811 /* ここに処理本体を記述します #_TEFB_# */ … … 800 830 return(E_ID); 801 831 } 832 (void)p_cellcb; // to avoid unused warning 802 833 803 834 /* ここに処理本体を記述します #_TEFB_# */ … … 821 852 return(E_ID); 822 853 } 854 (void)p_cellcb; // to avoid unused warning 823 855 824 856 /* ここに処理本体を記述します #_TEFB_# */ … … 863 895 return(E_ID); 864 896 } /* end if VALID_IDX(idx) */ 897 (void)p_cellcb; // to avoid unused warning 865 898 866 899 /* ここに処理本体を記述します #_TEFB_# */ … … 883 916 return(E_ID); 884 917 } 918 (void)p_cellcb; // to avoid unused warning 885 919 886 920 /* ここに処理本体を記述します #_TEFB_# */ … … 903 937 return(E_ID); 904 938 } 939 (void)p_cellcb; // to avoid unused warning 905 940 906 941 /* ここに処理本体を記述します #_TEFB_# */ … … 923 958 return(E_ID); 924 959 } 960 (void)p_cellcb; // to avoid unused warning 925 961 926 962 /* ここに処理本体を記述します #_TEFB_# */ … … 944 980 return(E_ID); 945 981 } /* end if VALID_IDX(idx) */ 982 (void)p_cellcb; // to avoid unused warning 946 983 947 984 /* ここに処理本体を記述します #_TEFB_# */ … … 966 1003 return(E_ID); 967 1004 } 1005 (void)p_cellcb; // to avoid unused warning 968 1006 969 1007 /* ここに処理本体を記述します #_TEFB_# */ … … 988 1026 return(E_ID); 989 1027 } 1028 (void)p_cellcb; // to avoid unused warning 990 1029 991 1030 /* ここに処理本体を記述します #_TEFB_# */ … … 1010 1049 return(E_ID); 1011 1050 } 1051 (void)p_cellcb; // to avoid unused warning 1012 1052 1013 1053 /* ここに処理本体を記述します #_TEFB_# */ … … 1031 1071 return(E_ID); 1032 1072 } /* end if VALID_IDX(idx) */ 1073 (void)p_cellcb; // to avoid unused warning 1033 1074 1034 1075 /* ここに処理本体を記述します #_TEFB_# */ … … 1051 1092 return(E_ID); 1052 1093 } /* end if VALID_IDX(idx) */ 1094 (void)p_cellcb; // to avoid unused warning 1053 1095 1054 1096 /* ここに処理本体を記述します #_TEFB_# */ … … 1071 1113 return(E_ID); 1072 1114 } /* end if VALID_IDX(idx) */ 1115 (void)p_cellcb; // to avoid unused warning 1073 1116 1074 1117 /* ここに処理本体を記述します #_TEFB_# */ … … 1091 1134 return(E_ID); 1092 1135 } /* end if VALID_IDX(idx) */ 1136 (void)p_cellcb; // to avoid unused warning 1093 1137 1094 1138 /* ここに処理本体を記述します #_TEFB_# */ … … 1112 1156 return(E_ID); 1113 1157 } /* end if VALID_IDX(idx) */ 1158 (void)p_cellcb; // to avoid unused warning 1114 1159 1115 1160 /* ここに処理本体を記述します #_TEFB_# */ … … 1134 1179 return(E_ID); 1135 1180 } /* end if VALID_IDX(idx) */ 1181 (void)p_cellcb; // to avoid unused warning 1136 1182 1137 1183 /* ここに処理本体を記述します #_TEFB_# */ … … 1156 1202 return(E_ID); 1157 1203 } /* end if VALID_IDX(idx) */ 1204 (void)p_cellcb; // to avoid unused warning 1158 1205 1159 1206 /* ここに処理本体を記述します #_TEFB_# */ … … 1178 1225 return(E_ID); 1179 1226 } /* end if VALID_IDX(idx) */ 1227 (void)p_cellcb; // to avoid unused warning 1180 1228 1181 1229 /* ここに処理本体を記述します #_TEFB_# */ … … 1199 1247 return(E_ID); 1200 1248 } 1249 (void)p_cellcb; // to avoid unused warning 1201 1250 1202 1251 /* ここに処理本体を記述します #_TEFB_# */ … … 1220 1269 return(E_ID); 1221 1270 } 1271 (void)p_cellcb; // to avoid unused warning 1222 1272 1223 1273 /* ここに処理本体を記述します #_TEFB_# */ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecsgen.rb
r359 r374 5 5 # Generator for TOPPERS Embedded Component System 6 6 # 7 # Copyright (C) 2008-201 7by TOPPERS Project7 # Copyright (C) 2008-2019 by TOPPERS Project 8 8 #-- 9 9 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 54 54 # Authors list is in i-ro-ha order. 55 55 #Version:: see version.rb 56 $Copyright = "Copyright(c) 2008-201 7, TOPPERS project. All rights reserved."56 $Copyright = "Copyright(c) 2008-2019, TOPPERS project. All rights reserved." 57 57 $License = "TOPPERS License" 58 58 … … 223 223 analyze_option addtional_option_parser 224 224 load_modules 225 setup 225 if ! $TECSFLOW then 226 setup 227 end 226 228 227 229 dbgPrint "tecspath: #{$tecsgen_base_path}, __FILE__=#{__FILE__}\n" … … 284 286 ARGV.each { |a| $arguments += " " + a } 285 287 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 287 290 $gen_base = "gen" # string: folder path to place generated files 288 291 $gen = $gen_base # string: folder path to place generated files … … 385 388 $unopt = true 386 389 } 390 parser.on('--unoptimize-entry', 'unoptimize entry port') { 391 $unopt_entry = true 392 } 387 393 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' ){ 388 394 |arg| … … 465 471 } 466 472 467 if ARGV.empty? && ! $print_version && ! $unit_test 473 if ARGV.empty? && ! $print_version && ! $unit_test && ! $TECSFLOW 468 474 ARGV.options{|parser| 469 475 puts parser.help … … 482 488 # このファイルを誤って読み込むと、異なるバージョン名を表示してしまう 483 489 require_tecsgen_lib 'tecslib/version.rb' 484 if $t ecscde_versionthen485 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" 486 492 elsif ! $no_banner || $print_version 487 493 STDERR << "tecsgen version #{$version} #{$Copyright}\n" … … 490 496 STDERR << "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE} patchlevel #{RUBY_PATCHLEVEL}) [#{RUBY_PLATFORM}]\n" 491 497 end 492 if $print_version && ARGV.empty? 498 if $print_version && ARGV.empty? && ! $TECSFLOW 493 499 exit 494 500 end … … 518 524 require_tecsgen_lib 'tecslib/core/tool_info.rb' 519 525 require_tecsgen_lib 'tecslib/core/tecsinfo.rb' 526 require_tecsgen_lib 'tecslib/core/unjoin_plugin.rb' 520 527 require_tecsgen_lib 'tecslib/plugin/CelltypePlugin.rb' 521 528 require_tecsgen_lib 'tecslib/plugin/CompositePlugin.rb' … … 601 608 # クラス変数のリセットを確実に行う必要がある 602 609 603 if $TECSCDE != true then610 if $TECSCDE != true && $TECSFLOW != true then 604 611 begin 605 612 TECSGEN.init … … 607 614 tecsgen.run1 608 615 tecsgen.run2 616 tecsgen.dump_tecsgen_rbdmp 609 617 rescue => evar 610 618 print_exception( evar ) -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecsgen_rcov.rb
r337 r374 44 44 # Usage: tecsgen_rcov.rb [options] CDL-file.cdl 45 45 # 46 47 $:.unshift(File.dirname(__FILE__)) 48 46 49 require 'simplecov' 47 SimpleCov.command_name "tecsgen#{ $$}"50 SimpleCov.command_name "tecsgen#{Time.now.to_f}" 48 51 SimpleCov.root File.dirname( File.expand_path __FILE__ ) 49 52 SimpleCov.at_exit do -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/C_parser.tab.rb
r337 r374 1 1 # 2 2 # DO NOT MODIFY!!!! 3 # This file is automatically generated by Racc 1.4. 143 # This file is automatically generated by Racc 1.4.9 4 4 # from Racc grammer file "". 5 5 # … … 8 8 class C_parser < Racc::Parser 9 9 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] 10 module_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] 222 229 #print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}: type_name'\n" ) 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 Console.puts "error: #{locale[0]}: line #{locale[1]}#{msg}"263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 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 ] 296 303 #print "b_no_type_name=#{b_no_type_name} #{locale[0]}: line #{locale[1]}\n" 297 298 304 @b_no_type_name = b_no_type_name 305 end 299 306 300 307 ...end C_parser.y.rb/module_eval... … … 302 309 303 310 clist = [ 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) 427 452 idx = 0 428 453 clist.each do |str| … … 434 459 435 460 clist = [ 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) 565 604 idx = 0 566 605 clist.each do |str| … … 572 611 573 612 racc_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, 596 614 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 ] 614 658 615 659 racc_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 ] 656 705 657 706 racc_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, 688 740 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 689 741 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, 724 743 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 725 744 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 745 306 ] 746 747 racc_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, 726 776 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 ] 728 787 729 788 racc_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 ] 738 798 739 799 racc_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 ] 748 809 749 810 racc_reduce_table = [ 750 811 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, 771 823 1, 104, :_reduce_none, 824 4, 104, :_reduce_13, 772 825 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, 787 836 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, 794 848 1, 112, :_reduce_none, 795 3, 112, :_reduce_45, 796 3, 112, :_reduce_46, 849 4, 112, :_reduce_38, 797 850 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, 802 854 1, 114, :_reduce_none, 803 3, 114, :_reduce_ 53,804 3, 114, :_reduce_ 54,855 3, 114, :_reduce_44, 856 3, 114, :_reduce_45, 805 857 1, 115, :_reduce_none, 806 3, 115, :_reduce_56, 858 3, 115, :_reduce_47, 859 3, 115, :_reduce_48, 807 860 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, 809 865 1, 117, :_reduce_none, 810 3, 117, :_reduce_60, 866 3, 117, :_reduce_55, 867 3, 117, :_reduce_56, 811 868 1, 118, :_reduce_none, 812 3, 118, :_reduce_ 62,869 3, 118, :_reduce_58, 813 870 1, 119, :_reduce_none, 814 3, 119, :_reduce_6 4,871 3, 119, :_reduce_60, 815 872 1, 120, :_reduce_none, 816 5, 120, :_reduce_66,817 1, 1 02, :_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, 821 878 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, 828 899 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, 856 933 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, 873 946 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, 880 951 1, 149, :_reduce_none, 881 3, 149, :_reduce_none,882 1, 1 50, :_reduce_none,952 2, 149, :_reduce_none, 953 1, 148, :_reduce_none, 883 954 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, 1 52, :_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, 899 970 1, 153, :_reduce_none, 900 5, 153, :_reduce_none,971 3, 153, :_reduce_none, 901 972 1, 154, :_reduce_none, 902 973 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, 928 995 1, 159, :_reduce_none, 929 996 2, 159, :_reduce_none, 997 1, 157, :_reduce_none, 998 5, 157, :_reduce_none, 930 999 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, 942 1032 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 1081 racc_reduce_n = 269 1082 1083 racc_shift_n = 447 997 1084 998 1085 racc_token_table = { … … 1014 1101 "++" => 15, 1015 1102 "--" => 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 1184 racc_nt_base = 97 1097 1185 1098 1186 racc_use_result_var = true … … 1132 1220 "\"++\"", 1133 1221 "\"--\"", 1222 "\"{\"", 1223 "\"}\"", 1134 1224 "\",\"", 1135 1225 "SIZEOF", … … 1156 1246 "\"?\"", 1157 1247 "\":\"", 1158 "\";\"",1159 1248 "\"=\"", 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",1194 1249 "\"+=\"", 1195 1250 "\"-=\"", … … 1202 1257 "\"|=\"", 1203 1258 "\"^=\"", 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", 1204 1281 "__INLINE__", 1205 1282 "INLINE", 1206 1283 "__INLINE", 1207 1284 "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", 1212 1300 "\"::\"", 1301 "_ASM", 1213 1302 "$start", 1214 1303 "all", … … 1219 1308 "expression", 1220 1309 "postfix_expression", 1221 "argument_ list",1310 "argument_expression_list", 1222 1311 "type_qualifier", 1312 "type_name", 1313 "initializer_list", 1314 "assignment_expression", 1223 1315 "unary_expression", 1224 1316 "unary_operator", 1225 1317 "cast_expression", 1226 "type_name",1227 1318 "multiplicative_expression", 1228 1319 "additive_expression", … … 1236 1327 "logical_or_expression", 1237 1328 "conditional_expression", 1329 "assignment_operator", 1238 1330 "constant_expression", 1239 1331 "declaration", 1240 1332 "declaration_specifiers", 1241 1333 "init_declarator_list", 1242 "storage_class ",1334 "storage_class_specifier", 1243 1335 "type_specifier", 1336 "function_specifier", 1244 1337 "init_declarator", 1245 1338 "declarator", … … 1255 1348 "struct_declaration", 1256 1349 "struct_declarator_list", 1257 " type_specifier_qualifier_list",1350 "specifier_qualifier_list", 1258 1351 "struct_declarator", 1259 1352 "union_term", … … 1263 1356 "union_declarator_list", 1264 1357 "union_declarator", 1265 "enum_type",1266 1358 "enumerator_list", 1267 1359 "enumerator", … … 1269 1361 "direct_declarator", 1270 1362 "parameter_type_list", 1363 "identifier_list", 1364 "type_qualifier_list", 1271 1365 "parameter_list", 1272 1366 "parameter_declaration", 1273 1367 "abstract_declarator", 1274 1368 "direct_abstract_declarator", 1275 "initializer_list",1276 1369 "extension_statement", 1277 " statement",1370 "cdl_statement", 1278 1371 "typedef", 1279 1372 "func_def", 1280 1373 "declarator_list", 1281 "compoundstatement", 1282 "infunc_statement_list", 1283 "infunc_statement", 1374 "compound_statement", 1375 "statement", 1376 "labeled_statement", 1377 "expression_statement", 1284 1378 "ifstatement", 1285 1379 "whilestatement", … … 1287 1381 "forstatement", 1288 1382 "switchstatement", 1289 " labelstatement",1290 " gotostatement",1291 " expressionstatement",1292 " assignment_operator" ]1383 "jump_statement", 1384 "asm_statement", 1385 "block_item_list", 1386 "block_item" ] 1293 1387 1294 1388 Racc_debug_parser = false … … 1300 1394 # reduce 1 omitted 1301 1395 1302 module_eval(<<'.,.,', 'C_parser.y.rb', 5 2)1396 module_eval(<<'.,.,', 'C_parser.y.rb', 57) 1303 1397 def _reduce_2(val, _values, result) 1304 1398 result = [ :IDENTIFIER, val[0] ] … … 1307 1401 .,., 1308 1402 1309 module_eval(<<'.,.,', 'C_parser.y.rb', 6 0)1403 module_eval(<<'.,.,', 'C_parser.y.rb', 65) 1310 1404 def _reduce_3(val, _values, result) 1311 1405 result = [ :INTEGER_CONSTANT, val[0] ] … … 1314 1408 .,., 1315 1409 1316 module_eval(<<'.,.,', 'C_parser.y.rb', 6 2)1410 module_eval(<<'.,.,', 'C_parser.y.rb', 67) 1317 1411 def _reduce_4(val, _values, result) 1318 1412 result = [ :FLOATING_CONSTANT, val[0] ] … … 1321 1415 .,., 1322 1416 1323 module_eval(<<'.,.,', 'C_parser.y.rb', 6 4)1417 module_eval(<<'.,.,', 'C_parser.y.rb', 69) 1324 1418 def _reduce_5(val, _values, result) 1325 1419 result = [ :OCTAL_CONSTANT, val[0] ] … … 1328 1422 .,., 1329 1423 1330 module_eval(<<'.,.,', 'C_parser.y.rb', 66)1424 module_eval(<<'.,.,', 'C_parser.y.rb', 71) 1331 1425 def _reduce_6(val, _values, result) 1332 1426 result = [ :HEX_CONSTANT, val[0] ] … … 1335 1429 .,., 1336 1430 1337 module_eval(<<'.,.,', 'C_parser.y.rb', 68)1431 module_eval(<<'.,.,', 'C_parser.y.rb', 73) 1338 1432 def _reduce_7(val, _values, result) 1339 1433 result = [ :CHARACTER_LITERAL, val[0] ] … … 1342 1436 .,., 1343 1437 1344 module_eval(<<'.,.,', 'C_parser.y.rb', 7 0)1438 module_eval(<<'.,.,', 'C_parser.y.rb', 75) 1345 1439 def _reduce_8(val, _values, result) 1346 1440 result = [ :STRING_LITERAL_LIST, val[0] ] … … 1349 1443 .,., 1350 1444 1351 module_eval(<<'.,.,', 'C_parser.y.rb', 7 2)1445 module_eval(<<'.,.,', 'C_parser.y.rb', 77) 1352 1446 def _reduce_9(val, _values, result) 1353 1447 result = [ :PARENTHESES, val[1].get_elements ] … … 1356 1450 .,., 1357 1451 1358 module_eval(<<'.,.,', 'C_parser.y.rb', 76)1452 module_eval(<<'.,.,', 'C_parser.y.rb', 81) 1359 1453 def _reduce_10(val, _values, result) 1360 1454 result = [val[0]] … … 1363 1457 .,., 1364 1458 1365 module_eval(<<'.,.,', 'C_parser.y.rb', 78)1459 module_eval(<<'.,.,', 'C_parser.y.rb', 83) 1366 1460 def _reduce_11(val, _values, result) 1367 1461 result << val[1] … … 1372 1466 # reduce 12 omitted 1373 1467 1374 # reduce 13 omitted 1468 module_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 .,., 1375 1474 1376 1475 # reduce 14 omitted 1377 1476 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 1481 module_eval(<<'.,.,', 'C_parser.y.rb', 94) 1482 def _reduce_17(val, _values, result) 1387 1483 result = [ :OP_DOT, val[0], val[2] ] 1388 1484 result … … 1390 1486 .,., 1391 1487 1392 module_eval(<<'.,.,', 'C_parser.y.rb', 9 0)1393 def _reduce_1 7(val, _values, result)1488 module_eval(<<'.,.,', 'C_parser.y.rb', 96) 1489 def _reduce_18(val, _values, result) 1394 1490 result = [ :OP_REF, val[0], val[2] ] 1395 1491 result … … 1397 1493 .,., 1398 1494 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) 1495 module_eval(<<'.,.,', 'C_parser.y.rb', 97) 1407 1496 def _reduce_19(val, _values, result) 1408 1497 result = val[0] … … 1411 1500 .,., 1412 1501 1413 # reduce 20 omitted 1502 module_eval(<<'.,.,', 'C_parser.y.rb', 98) 1503 def _reduce_20(val, _values, result) 1504 result = val[0] 1505 result 1506 end 1507 .,., 1414 1508 1415 1509 # reduce 21 omitted … … 1419 1513 # reduce 23 omitted 1420 1514 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 1519 module_eval(<<'.,.,', 'C_parser.y.rb', 111) 1520 def _reduce_26(val, _values, result) 1423 1521 result = [ val[0], val[1] ] 1424 1522 result … … 1426 1524 .,., 1427 1525 1428 module_eval(<<'.,.,', 'C_parser.y.rb', 1 06)1429 def _reduce_2 5(val, _values, result)1526 module_eval(<<'.,.,', 'C_parser.y.rb', 113) 1527 def _reduce_27(val, _values, result) 1430 1528 result = [ :OP_SIZEOF_EXPR, val[1] ] 1431 1529 result … … 1433 1531 .,., 1434 1532 1435 module_eval(<<'.,.,', 'C_parser.y.rb', 1 08)1436 def _reduce_2 6(val, _values, result)1533 module_eval(<<'.,.,', 'C_parser.y.rb', 115) 1534 def _reduce_28(val, _values, result) 1437 1535 result = [ :OP_SIZEOF_TYPE, val[1] ] 1438 1536 result … … 1440 1538 .,., 1441 1539 1442 module_eval(<<'.,.,', 'C_parser.y.rb', 1 09)1443 def _reduce_2 7(val, _values, result)1540 module_eval(<<'.,.,', 'C_parser.y.rb', 116) 1541 def _reduce_29(val, _values, result) 1444 1542 result = val[1] 1445 1543 result … … 1447 1545 .,., 1448 1546 1449 module_eval(<<'.,.,', 'C_parser.y.rb', 11 0)1450 def _reduce_ 28(val, _values, result)1547 module_eval(<<'.,.,', 'C_parser.y.rb', 117) 1548 def _reduce_30(val, _values, result) 1451 1549 result = val[1] 1452 1550 result … … 1454 1552 .,., 1455 1553 1456 module_eval(<<'.,.,', 'C_parser.y.rb', 1 13)1457 def _reduce_ 29(val, _values, result)1554 module_eval(<<'.,.,', 'C_parser.y.rb', 120) 1555 def _reduce_31(val, _values, result) 1458 1556 result = :OP_U_AMP 1459 1557 result … … 1461 1559 .,., 1462 1560 1463 module_eval(<<'.,.,', 'C_parser.y.rb', 1 14)1464 def _reduce_3 0(val, _values, result)1561 module_eval(<<'.,.,', 'C_parser.y.rb', 121) 1562 def _reduce_32(val, _values, result) 1465 1563 result = :OP_U_ASTER 1466 1564 result … … 1468 1566 .,., 1469 1567 1470 module_eval(<<'.,.,', 'C_parser.y.rb', 1 15)1471 def _reduce_3 1(val, _values, result)1568 module_eval(<<'.,.,', 'C_parser.y.rb', 122) 1569 def _reduce_33(val, _values, result) 1472 1570 result = :OP_U_PLUS 1473 1571 result … … 1475 1573 .,., 1476 1574 1477 module_eval(<<'.,.,', 'C_parser.y.rb', 1 16)1478 def _reduce_3 2(val, _values, result)1575 module_eval(<<'.,.,', 'C_parser.y.rb', 123) 1576 def _reduce_34(val, _values, result) 1479 1577 result = :OP_U_MINUS 1480 1578 result … … 1482 1580 .,., 1483 1581 1484 module_eval(<<'.,.,', 'C_parser.y.rb', 1 17)1485 def _reduce_3 3(val, _values, result)1582 module_eval(<<'.,.,', 'C_parser.y.rb', 124) 1583 def _reduce_35(val, _values, result) 1486 1584 result = :OP_U_TILDE 1487 1585 result … … 1489 1587 .,., 1490 1588 1491 module_eval(<<'.,.,', 'C_parser.y.rb', 1 18)1492 def _reduce_3 4(val, _values, result)1589 module_eval(<<'.,.,', 'C_parser.y.rb', 125) 1590 def _reduce_36(val, _values, result) 1493 1591 result = :OP_U_EXCLAM 1494 1592 result … … 1496 1594 .,., 1497 1595 1498 # reduce 3 5omitted1499 1500 module_eval(<<'.,.,', 'C_parser.y.rb', 1 23)1501 def _reduce_3 6(val, _values, result)1596 # reduce 37 omitted 1597 1598 module_eval(<<'.,.,', 'C_parser.y.rb', 130) 1599 def _reduce_38(val, _values, result) 1502 1600 result = [ :CAST, val[1], val[3] ] 1503 1601 result … … 1505 1603 .,., 1506 1604 1507 # reduce 3 7omitted1508 1509 module_eval(<<'.,.,', 'C_parser.y.rb', 1 28)1510 def _reduce_ 38(val, _values, result)1605 # reduce 39 omitted 1606 1607 module_eval(<<'.,.,', 'C_parser.y.rb', 135) 1608 def _reduce_40(val, _values, result) 1511 1609 result = [ :OP_MULT, val[0], val[2] ] 1512 1610 result … … 1514 1612 .,., 1515 1613 1516 module_eval(<<'.,.,', 'C_parser.y.rb', 13 0)1517 def _reduce_ 39(val, _values, result)1614 module_eval(<<'.,.,', 'C_parser.y.rb', 137) 1615 def _reduce_41(val, _values, result) 1518 1616 result = [ :OP_DIV, val[0], val[2] ] 1519 1617 result … … 1521 1619 .,., 1522 1620 1523 module_eval(<<'.,.,', 'C_parser.y.rb', 13 2)1524 def _reduce_4 0(val, _values, result)1621 module_eval(<<'.,.,', 'C_parser.y.rb', 139) 1622 def _reduce_42(val, _values, result) 1525 1623 result = [ :OP_REMAIN, val[0], val[2] ] 1526 1624 result … … 1528 1626 .,., 1529 1627 1530 # reduce 4 1omitted1531 1532 module_eval(<<'.,.,', 'C_parser.y.rb', 1 37)1533 def _reduce_4 2(val, _values, result)1628 # reduce 43 omitted 1629 1630 module_eval(<<'.,.,', 'C_parser.y.rb', 144) 1631 def _reduce_44(val, _values, result) 1534 1632 result = [ :OP_ADD, val[0], val[2] ] 1535 1633 result … … 1537 1635 .,., 1538 1636 1539 module_eval(<<'.,.,', 'C_parser.y.rb', 1 39)1540 def _reduce_4 3(val, _values, result)1637 module_eval(<<'.,.,', 'C_parser.y.rb', 146) 1638 def _reduce_45(val, _values, result) 1541 1639 result = [ :OP_SUB, val[0], val[2] ] 1542 1640 result … … 1544 1642 .,., 1545 1643 1546 # reduce 4 4omitted1547 1548 module_eval(<<'.,.,', 'C_parser.y.rb', 1 44)1549 def _reduce_4 5(val, _values, result)1644 # reduce 46 omitted 1645 1646 module_eval(<<'.,.,', 'C_parser.y.rb', 151) 1647 def _reduce_47(val, _values, result) 1550 1648 result = [ :OP_LSFT, val[0], val[2] ] 1551 1649 result … … 1553 1651 .,., 1554 1652 1555 module_eval(<<'.,.,', 'C_parser.y.rb', 1 46)1556 def _reduce_4 6(val, _values, result)1653 module_eval(<<'.,.,', 'C_parser.y.rb', 153) 1654 def _reduce_48(val, _values, result) 1557 1655 result = [ :OP_RSFT, val[0], val[2] ] 1558 1656 result … … 1560 1658 .,., 1561 1659 1562 # reduce 4 7omitted1563 1564 module_eval(<<'.,.,', 'C_parser.y.rb', 15 1)1565 def _reduce_ 48(val, _values, result)1660 # reduce 49 omitted 1661 1662 module_eval(<<'.,.,', 'C_parser.y.rb', 158) 1663 def _reduce_50(val, _values, result) 1566 1664 result = [ :OP_LT, val[0], val[2] ] 1567 1665 result … … 1569 1667 .,., 1570 1668 1571 module_eval(<<'.,.,', 'C_parser.y.rb', 1 53)1572 def _reduce_ 49(val, _values, result)1669 module_eval(<<'.,.,', 'C_parser.y.rb', 160) 1670 def _reduce_51(val, _values, result) 1573 1671 result = [ :OP_GT, val[0], val[2] ] 1574 1672 result … … 1576 1674 .,., 1577 1675 1578 module_eval(<<'.,.,', 'C_parser.y.rb', 1 55)1579 def _reduce_5 0(val, _values, result)1676 module_eval(<<'.,.,', 'C_parser.y.rb', 162) 1677 def _reduce_52(val, _values, result) 1580 1678 result = [ :OP_LE, val[0], val[2] ] 1581 1679 result … … 1583 1681 .,., 1584 1682 1585 module_eval(<<'.,.,', 'C_parser.y.rb', 1 57)1586 def _reduce_5 1(val, _values, result)1683 module_eval(<<'.,.,', 'C_parser.y.rb', 164) 1684 def _reduce_53(val, _values, result) 1587 1685 result = [ :OP_GE, val[0], val[2] ] 1588 1686 result … … 1590 1688 .,., 1591 1689 1592 # reduce 5 2omitted1593 1594 module_eval(<<'.,.,', 'C_parser.y.rb', 16 2)1595 def _reduce_5 3(val, _values, result)1690 # reduce 54 omitted 1691 1692 module_eval(<<'.,.,', 'C_parser.y.rb', 169) 1693 def _reduce_55(val, _values, result) 1596 1694 result = [ :OP_EQ, val[0], val[2] ] 1597 1695 result … … 1599 1697 .,., 1600 1698 1601 module_eval(<<'.,.,', 'C_parser.y.rb', 1 64)1602 def _reduce_5 4(val, _values, result)1699 module_eval(<<'.,.,', 'C_parser.y.rb', 171) 1700 def _reduce_56(val, _values, result) 1603 1701 result = [ :OP_NE, val[0], val[2] ] 1604 1702 result … … 1606 1704 .,., 1607 1705 1608 # reduce 5 5omitted1609 1610 module_eval(<<'.,.,', 'C_parser.y.rb', 1 69)1611 def _reduce_5 6(val, _values, result)1706 # reduce 57 omitted 1707 1708 module_eval(<<'.,.,', 'C_parser.y.rb', 176) 1709 def _reduce_58(val, _values, result) 1612 1710 result = [ :OP_AND, val[0], val[2] ] 1613 1711 result … … 1615 1713 .,., 1616 1714 1617 # reduce 5 7omitted1618 1619 module_eval(<<'.,.,', 'C_parser.y.rb', 1 74)1620 def _reduce_ 58(val, _values, result)1715 # reduce 59 omitted 1716 1717 module_eval(<<'.,.,', 'C_parser.y.rb', 181) 1718 def _reduce_60(val, _values, result) 1621 1719 result = [ :OP_EOR, val[0], val[2] ] 1622 1720 result … … 1624 1722 .,., 1625 1723 1626 # reduce 59omitted1627 1628 module_eval(<<'.,.,', 'C_parser.y.rb', 1 79)1629 def _reduce_6 0(val, _values, result)1724 # reduce 61 omitted 1725 1726 module_eval(<<'.,.,', 'C_parser.y.rb', 186) 1727 def _reduce_62(val, _values, result) 1630 1728 result = [ :OP_OR, val[0], val[2] ] 1631 1729 result … … 1633 1731 .,., 1634 1732 1635 # reduce 6 1omitted1636 1637 module_eval(<<'.,.,', 'C_parser.y.rb', 1 84)1638 def _reduce_6 2(val, _values, result)1733 # reduce 63 omitted 1734 1735 module_eval(<<'.,.,', 'C_parser.y.rb', 191) 1736 def _reduce_64(val, _values, result) 1639 1737 result = [ :OP_LAND, val[0], val[2] ] 1640 1738 result … … 1642 1740 .,., 1643 1741 1644 # reduce 6 3omitted1645 1646 module_eval(<<'.,.,', 'C_parser.y.rb', 1 89)1647 def _reduce_6 4(val, _values, result)1742 # reduce 65 omitted 1743 1744 module_eval(<<'.,.,', 'C_parser.y.rb', 196) 1745 def _reduce_66(val, _values, result) 1648 1746 result = [ :OP_LOR, val[0], val[2] ] 1649 1747 result … … 1651 1749 .,., 1652 1750 1653 # reduce 6 5omitted1654 1655 module_eval(<<'.,.,', 'C_parser.y.rb', 194)1656 def _reduce_6 6(val, _values, result)1751 # reduce 67 omitted 1752 1753 module_eval(<<'.,.,', 'C_parser.y.rb', 201) 1754 def _reduce_68(val, _values, result) 1657 1755 result = [ :OP_CEX, val[0], val[2].get_elements, val[4] ] 1658 1756 result … … 1660 1758 .,., 1661 1759 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 1786 module_eval(<<'.,.,', 'C_parser.y.rb', 223) 1787 def _reduce_82(val, _values, result) 1664 1788 result = Expression.new( val[0] ) 1665 1789 # result.print … … 1669 1793 .,., 1670 1794 1671 module_eval(<<'.,.,', 'C_parser.y.rb', 208) 1672 def _reduce_68(val, _values, result) 1795 module_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 1803 module_eval(<<'.,.,', 'C_parser.y.rb', 234) 1804 def _reduce_84(val, _values, result) 1673 1805 result = Expression.new( val[0] ) 1674 1806 # result.print … … 1685 1817 .,., 1686 1818 1687 # reduce 69omitted1688 1689 module_eval(<<'.,.,', 'C_parser.y.rb', 2 37)1690 def _reduce_ 70(val, _values, result)1819 # reduce 85 omitted 1820 1821 module_eval(<<'.,.,', 'C_parser.y.rb', 261) 1822 def _reduce_86(val, _values, result) 1691 1823 result = CIntType.new( -3 ) # storage class は無視 1692 1824 … … 1695 1827 .,., 1696 1828 1697 # reduce 71 omitted 1698 1699 module_eval(<<'.,.,', 'C_parser.y.rb', 242) 1700 def _reduce_72(val, _values, result) 1829 module_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 1839 module_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 1847 module_eval(<<'.,.,', 'C_parser.y.rb', 274) 1848 def _reduce_90(val, _values, result) 1701 1849 result = CIntType.new( -3 ) 1702 1850 result.set_qualifier val[0] … … 1706 1854 .,., 1707 1855 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) 1856 module_eval(<<'.,.,', 'C_parser.y.rb', 279) 1857 def _reduce_91(val, _values, result) 1726 1858 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 1869 module_eval(<<'.,.,', 'C_parser.y.rb', 287) 1870 def _reduce_94(val, _values, result) 1735 1871 result = [val[0]] 1736 1872 result … … 1738 1874 .,., 1739 1875 1740 module_eval(<<'.,.,', 'C_parser.y.rb', 2 64)1741 def _reduce_ 77(val, _values, result)1876 module_eval(<<'.,.,', 'C_parser.y.rb', 289) 1877 def _reduce_95(val, _values, result) 1742 1878 result << val[2] 1743 1879 result … … 1745 1881 .,., 1746 1882 1747 # reduce 78omitted1748 1749 module_eval(<<'.,.,', 'C_parser.y.rb', 2 69)1750 def _reduce_ 79(val, _values, result)1883 # reduce 96 omitted 1884 1885 module_eval(<<'.,.,', 'C_parser.y.rb', 294) 1886 def _reduce_97(val, _values, result) 1751 1887 val[0].set_initializer( val[2] ) 1752 1888 result … … 1754 1890 .,., 1755 1891 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 1900 module_eval(<<'.,.,', 'C_parser.y.rb', 304) 1901 def _reduce_102(val, _values, result) 1758 1902 set_no_type_name true; result = CVoidType.new 1759 1903 result … … 1761 1905 .,., 1762 1906 1763 module_eval(<<'.,.,', 'C_parser.y.rb', 273) 1764 def _reduce_81(val, _values, result) 1907 module_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 1914 module_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 1921 module_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 1928 module_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 1935 module_eval(<<'.,.,', 'C_parser.y.rb', 314) 1936 def _reduce_107(val, _values, result) 1765 1937 set_no_type_name true; result = CFloatType.new(-32) 1766 1938 result … … 1768 1940 .,., 1769 1941 1770 module_eval(<<'.,.,', 'C_parser.y.rb', 274)1771 def _reduce_ 82(val, _values, result)1942 module_eval(<<'.,.,', 'C_parser.y.rb', 316) 1943 def _reduce_108(val, _values, result) 1772 1944 set_no_type_name true; result = CFloatType.new(-64) 1773 1945 result … … 1775 1947 .,., 1776 1948 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) 1949 module_eval(<<'.,.,', 'C_parser.y.rb', 319) 1950 def _reduce_109(val, _values, result) 1842 1951 set_no_type_name true 1843 1952 result = CIntType.new( -3 ) … … 1848 1957 .,., 1849 1958 1850 module_eval(<<'.,.,', 'C_parser.y.rb', 293)1851 def _reduce_ 93(val, _values, result)1959 module_eval(<<'.,.,', 'C_parser.y.rb', 325) 1960 def _reduce_110(val, _values, result) 1852 1961 set_no_type_name true 1853 1962 result = CIntType.new( -3 ) … … 1858 1967 .,., 1859 1968 1860 module_eval(<<'.,.,', 'C_parser.y.rb', 302) 1861 def _reduce_94(val, _values, result) 1969 module_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 1976 module_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 1983 module_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 1990 module_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 1997 module_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 2004 module_eval(<<'.,.,', 'C_parser.y.rb', 344) 2005 def _reduce_116(val, _values, result) 1862 2006 StructType.set_define( true ) 1863 2007 result … … 1865 2009 .,., 1866 2010 1867 module_eval(<<'.,.,', 'C_parser.y.rb', 3 05)1868 def _reduce_ 95(val, _values, result)2011 module_eval(<<'.,.,', 'C_parser.y.rb', 347) 2012 def _reduce_117(val, _values, result) 1869 2013 StructType.end_of_parse 1870 2014 result = val[1] … … 1874 2018 .,., 1875 2019 1876 module_eval(<<'.,.,', 'C_parser.y.rb', 3 11)1877 def _reduce_ 96(val, _values, result)2020 module_eval(<<'.,.,', 'C_parser.y.rb', 353) 2021 def _reduce_118(val, _values, result) 1878 2022 result = CStructType.new() 1879 2023 StructType.set_define( true ) … … 1883 2027 .,., 1884 2028 1885 module_eval(<<'.,.,', 'C_parser.y.rb', 3 16)1886 def _reduce_ 97(val, _values, result)2029 module_eval(<<'.,.,', 'C_parser.y.rb', 358) 2030 def _reduce_119(val, _values, result) 1887 2031 StructType.end_of_parse 1888 2032 result = val[1] … … 1892 2036 .,., 1893 2037 1894 module_eval(<<'.,.,', 'C_parser.y.rb', 3 22)1895 def _reduce_ 98(val, _values, result)2038 module_eval(<<'.,.,', 'C_parser.y.rb', 364) 2039 def _reduce_120(val, _values, result) 1896 2040 StructType.set_define( false ) 1897 2041 StructType.end_of_parse … … 1902 2046 .,., 1903 2047 1904 module_eval(<<'.,.,', 'C_parser.y.rb', 3 28)1905 def _reduce_ 99(val, _values, result)2048 module_eval(<<'.,.,', 'C_parser.y.rb', 370) 2049 def _reduce_121(val, _values, result) 1906 2050 set_no_type_name true 1907 2051 result … … 1909 2053 .,., 1910 2054 1911 # reduce 1 00omitted1912 1913 # reduce 1 01omitted1914 1915 module_eval(<<'.,.,', 'C_parser.y.rb', 3 37)1916 def _reduce_1 02(val, _values, result)2055 # reduce 122 omitted 2056 2057 # reduce 123 omitted 2058 2059 module_eval(<<'.,.,', 'C_parser.y.rb', 379) 2060 def _reduce_124(val, _values, result) 1917 2061 result = CStructType.new( val[0].val ) 1918 2062 set_no_type_name true … … 1922 2066 .,., 1923 2067 1924 module_eval(<<'.,.,', 'C_parser.y.rb', 3 46)1925 def _reduce_1 03(val, _values, result)2068 module_eval(<<'.,.,', 'C_parser.y.rb', 388) 2069 def _reduce_125(val, _values, result) 1926 2070 val[1].each { |i| # i: Decl 1927 2071 i.set_type( val[0] ) … … 1936 2080 .,., 1937 2081 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) 2082 module_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 2100 module_eval(<<'.,.,', 'C_parser.y.rb', 417) 2101 def _reduce_129(val, _values, result) 1946 2102 result = val[1].merge val[0] 1947 2103 … … 1950 2106 .,., 1951 2107 1952 module_eval(<<'.,.,', 'C_parser.y.rb', 369) 1953 def _reduce_108(val, _values, result) 2108 # reduce 130 omitted 2109 2110 module_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 2119 module_eval(<<'.,.,', 'C_parser.y.rb', 427) 2120 def _reduce_132(val, _values, result) 1954 2121 result = CIntType.new( -3 ) 1955 2122 result.set_qualifier val[0] … … 1959 2126 .,., 1960 2127 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) 2128 module_eval(<<'.,.,', 'C_parser.y.rb', 433) 2129 def _reduce_133(val, _values, result) 1972 2130 result = [ val[0] ] 1973 2131 result … … 1975 2133 .,., 1976 2134 1977 module_eval(<<'.,.,', 'C_parser.y.rb', 382)1978 def _reduce_1 11(val, _values, result)2135 module_eval(<<'.,.,', 'C_parser.y.rb', 435) 2136 def _reduce_134(val, _values, result) 1979 2137 result << val[2] 1980 2138 result … … 1982 2140 .,., 1983 2141 1984 # reduce 1 12omitted1985 1986 # reduce 1 13omitted1987 1988 # reduce 1 14omitted1989 1990 # reduce 1 15omitted1991 1992 module_eval(<<'.,.,', 'C_parser.y.rb', 399)1993 def _reduce_1 16(val, _values, result)2142 # reduce 135 omitted 2143 2144 # reduce 136 omitted 2145 2146 # reduce 137 omitted 2147 2148 # reduce 138 omitted 2149 2150 module_eval(<<'.,.,', 'C_parser.y.rb', 452) 2151 def _reduce_139(val, _values, result) 1994 2152 set_no_type_name true 1995 2153 result … … 1997 2155 .,., 1998 2156 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 2203 module_eval(<<'.,.,', 'C_parser.y.rb', 495) 2204 def _reduce_163(val, _values, result) 2040 2205 result = :CONST 2041 2206 result … … 2043 2208 .,., 2044 2209 2045 module_eval(<<'.,.,', 'C_parser.y.rb', 447) 2046 def _reduce_135(val, _values, result) 2210 # reduce 164 omitted 2211 2212 module_eval(<<'.,.,', 'C_parser.y.rb', 498) 2213 def _reduce_165(val, _values, result) 2047 2214 result = :VOLATILE 2048 2215 result … … 2050 2217 .,., 2051 2218 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 2227 module_eval(<<'.,.,', 'C_parser.y.rb', 509) 2228 def _reduce_170(val, _values, result) 2054 2229 val[1].set_type( val[0] ) 2055 2230 result = val[1] … … 2059 2234 .,., 2060 2235 2061 # reduce 1 37omitted2062 2063 module_eval(<<'.,.,', 'C_parser.y.rb', 458)2064 def _reduce_1 38(val, _values, result)2236 # reduce 171 omitted 2237 2238 module_eval(<<'.,.,', 'C_parser.y.rb', 515) 2239 def _reduce_172(val, _values, result) 2065 2240 result = Decl.new( val[1].val ) 2066 2241 result.set_type( val[0] ) … … 2070 2245 .,., 2071 2246 2072 module_eval(<<'.,.,', 'C_parser.y.rb', 464)2073 def _reduce_1 39(val, _values, result)2247 module_eval(<<'.,.,', 'C_parser.y.rb', 521) 2248 def _reduce_173(val, _values, result) 2074 2249 result = Decl.new( val[0].val ) 2075 2250 result … … 2077 2252 .,., 2078 2253 2079 module_eval(<<'.,.,', 'C_parser.y.rb', 466)2080 def _reduce_1 40(val, _values, result)2254 module_eval(<<'.,.,', 'C_parser.y.rb', 523) 2255 def _reduce_174(val, _values, result) 2081 2256 result = val[1] 2082 2257 result … … 2084 2259 .,., 2085 2260 2086 module_eval(<<'.,.,', 'C_parser.y.rb', 469)2087 def _reduce_1 41(val, _values, result)2261 module_eval(<<'.,.,', 'C_parser.y.rb', 526) 2262 def _reduce_175(val, _values, result) 2088 2263 val[0].set_type( CArrayType.new( val[2] ) ) 2089 2264 result = val[0] … … 2093 2268 .,., 2094 2269 2095 module_eval(<<'.,.,', 'C_parser.y.rb', 474)2096 def _reduce_1 42(val, _values, result)2270 module_eval(<<'.,.,', 'C_parser.y.rb', 531) 2271 def _reduce_176(val, _values, result) 2097 2272 val[0].set_type( CArrayType.new ) 2098 2273 result = val[0] … … 2102 2277 .,., 2103 2278 2104 module_eval(<<'.,.,', 'C_parser.y.rb', 479)2105 def _reduce_1 43(val, _values, result)2279 module_eval(<<'.,.,', 'C_parser.y.rb', 536) 2280 def _reduce_177(val, _values, result) 2106 2281 # Generator.warning( "W6001 need 'void' for no parameter" ) 2107 2282 val[0].set_type( CFuncType.new ) … … 2112 2287 .,., 2113 2288 2114 module_eval(<<'.,.,', 'C_parser.y.rb', 487) 2115 def _reduce_144(val, _values, result) 2289 # reduce 178 omitted 2290 2291 module_eval(<<'.,.,', 'C_parser.y.rb', 543) 2292 def _reduce_179(val, _values, result) 2116 2293 # Generator.warning( "W6002 need 'void' for no parameter" ) 2117 2294 val[0].set_type( CFuncType.new ) … … 2122 2299 .,., 2123 2300 2124 module_eval(<<'.,.,', 'C_parser.y.rb', 494)2125 def _reduce_1 45(val, _values, result)2301 module_eval(<<'.,.,', 'C_parser.y.rb', 550) 2302 def _reduce_180(val, _values, result) 2126 2303 result = CPtrType.new 2127 2304 result … … 2129 2306 .,., 2130 2307 2131 module_eval(<<'.,.,', 'C_parser.y.rb', 497)2132 def _reduce_1 46(val, _values, result)2308 module_eval(<<'.,.,', 'C_parser.y.rb', 553) 2309 def _reduce_181(val, _values, result) 2133 2310 result = CPtrType.new 2134 2311 result.set_qualifier( val[1] ) … … 2138 2315 .,., 2139 2316 2140 module_eval(<<'.,.,', 'C_parser.y.rb', 5 02)2141 def _reduce_1 47(val, _values, result)2317 module_eval(<<'.,.,', 'C_parser.y.rb', 558) 2318 def _reduce_182(val, _values, result) 2142 2319 val[1].set_type(CPtrType.new) 2143 2320 result = val[1] … … 2147 2324 .,., 2148 2325 2149 module_eval(<<'.,.,', 'C_parser.y.rb', 5 07)2150 def _reduce_1 48(val, _values, result)2326 module_eval(<<'.,.,', 'C_parser.y.rb', 563) 2327 def _reduce_183(val, _values, result) 2151 2328 ptrtype = CPtrType.new 2152 2329 ptrtype.set_qualifier( val[1] ) … … 2158 2335 .,., 2159 2336 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 2379 module_eval(<<'.,.,', 'C_parser.y.rb', 630) 2380 def _reduce_205(val, _values, result) 2196 2381 Generator.warning( "W6003 need 'void' for no parameter" ) 2197 2382 … … 2200 2385 .,., 2201 2386 2202 # reduce 167omitted2203 2204 module_eval(<<'.,.,', 'C_parser.y.rb', 576)2205 def _reduce_ 168(val, _values, result)2387 # reduce 206 omitted 2388 2389 module_eval(<<'.,.,', 'C_parser.y.rb', 635) 2390 def _reduce_207(val, _values, result) 2206 2391 Generator.warning( "W6004 need 'void' for no parameter" ) 2207 2392 … … 2210 2395 .,., 2211 2396 2212 # reduce 169omitted2213 2214 module_eval(<<'.,.,', 'C_parser.y.rb', 583)2215 def _reduce_ 170(val, _values, result)2397 # reduce 208 omitted 2398 2399 module_eval(<<'.,.,', 'C_parser.y.rb', 642) 2400 def _reduce_209(val, _values, result) 2216 2401 result = val[0] 2217 2402 result … … 2219 2404 .,., 2220 2405 2221 module_eval(<<'.,.,', 'C_parser.y.rb', 585)2222 def _reduce_ 171(val, _values, result)2406 module_eval(<<'.,.,', 'C_parser.y.rb', 644) 2407 def _reduce_210(val, _values, result) 2223 2408 result = val[1] 2224 2409 result … … 2226 2411 .,., 2227 2412 2228 module_eval(<<'.,.,', 'C_parser.y.rb', 587)2229 def _reduce_ 172(val, _values, result)2413 module_eval(<<'.,.,', 'C_parser.y.rb', 646) 2414 def _reduce_211(val, _values, result) 2230 2415 result = val[1] 2231 2416 result … … 2233 2418 .,., 2234 2419 2235 module_eval(<<'.,.,', 'C_parser.y.rb', 589)2236 def _reduce_ 173(val, _values, result)2420 module_eval(<<'.,.,', 'C_parser.y.rb', 648) 2421 def _reduce_212(val, _values, result) 2237 2422 result = C_EXP.new( val[2] ) 2238 2423 result … … 2240 2425 .,., 2241 2426 2242 module_eval(<<'.,.,', 'C_parser.y.rb', 594)2243 def _reduce_ 174(val, _values, result)2427 module_eval(<<'.,.,', 'C_parser.y.rb', 653) 2428 def _reduce_213(val, _values, result) 2244 2429 result = [ val[0] ] 2245 2430 … … 2248 2433 .,., 2249 2434 2250 module_eval(<<'.,.,', 'C_parser.y.rb', 598)2251 def _reduce_ 175(val, _values, result)2435 module_eval(<<'.,.,', 'C_parser.y.rb', 657) 2436 def _reduce_214(val, _values, result) 2252 2437 val[0] << val[2] 2253 2438 result = val[0] … … 2257 2442 .,., 2258 2443 2259 # reduce 176omitted2260 2261 # reduce 177omitted2262 2263 # reduce 178omitted2264 2265 # reduce 179omitted2266 2267 # reduce 180omitted2268 2269 # reduce 181omitted2270 2271 # reduce 182omitted2272 2273 # reduce 183omitted2274 2275 # reduce 184omitted2276 2277 # reduce 185omitted2278 2279 # reduce 186omitted2280 2281 module_eval(<<'.,.,', 'C_parser.y.rb', 6 26)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 2466 module_eval(<<'.,.,', 'C_parser.y.rb', 685) 2467 def _reduce_226(val, _values, result) 2283 2468 val[2].each{ |i| 2284 2469 i.set_kind( :TYPEDEF ) … … 2291 2476 .,., 2292 2477 2293 module_eval(<<'.,.,', 'C_parser.y.rb', 6 35)2294 def _reduce_ 188(val, _values, result)2478 module_eval(<<'.,.,', 'C_parser.y.rb', 694) 2479 def _reduce_227(val, _values, result) 2295 2480 result = [ val[0] ] 2296 2481 result … … 2298 2483 .,., 2299 2484 2300 module_eval(<<'.,.,', 'C_parser.y.rb', 6 37)2301 def _reduce_ 189(val, _values, result)2485 module_eval(<<'.,.,', 'C_parser.y.rb', 696) 2486 def _reduce_228(val, _values, result) 2302 2487 result << val[2] 2303 2488 result … … 2305 2490 .,., 2306 2491 2307 # reduce 190 omitted2308 2309 # reduce 191 omitted2310 2311 # reduce 192 omitted2312 2313 # reduce 193 omitted2314 2315 # reduce 194 omitted2316 2317 # reduce 195 omitted2318 2319 # reduce 196 omitted2320 2321 # reduce 197 omitted2322 2323 # reduce 198 omitted2324 2325 # reduce 199 omitted2326 2327 # reduce 200 omitted2328 2329 # reduce 201 omitted2330 2331 # reduce 202 omitted2332 2333 # reduce 203 omitted2334 2335 # reduce 204 omitted2336 2337 # reduce 205 omitted2338 2339 # reduce 206 omitted2340 2341 # reduce 207 omitted2342 2343 # reduce 208 omitted2344 2345 # reduce 209 omitted2346 2347 # reduce 210 omitted2348 2349 # reduce 211 omitted2350 2351 # reduce 212 omitted2352 2353 # reduce 213 omitted2354 2355 # reduce 214 omitted2356 2357 # reduce 215 omitted2358 2359 # reduce 216 omitted2360 2361 # reduce 217 omitted2362 2363 # reduce 218 omitted2364 2365 # reduce 219 omitted2366 2367 # reduce 220 omitted2368 2369 # reduce 221 omitted2370 2371 # reduce 222 omitted2372 2373 # reduce 223 omitted2374 2375 # reduce 224 omitted2376 2377 # reduce 225 omitted2378 2379 # reduce 226 omitted2380 2381 # reduce 227 omitted2382 2383 # reduce 228 omitted2384 2385 2492 # reduce 229 omitted 2386 2493 … … 2405 2512 # reduce 239 omitted 2406 2513 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 2564 module_eval(<<'.,.,', 'C_parser.y.rb', 761) 2565 def _reduce_265(val, _values, result) 2409 2566 result = NamespacePath.new( val[0].val, false ) 2410 2567 result … … 2412 2569 .,., 2413 2570 2414 module_eval(<<'.,.,', 'C_parser.y.rb', 7 19)2415 def _reduce_2 41(val, _values, result)2571 module_eval(<<'.,.,', 'C_parser.y.rb', 762) 2572 def _reduce_266(val, _values, result) 2416 2573 result = NamespacePath.new( val[1].val, true ) 2417 2574 result … … 2419 2576 .,., 2420 2577 2421 module_eval(<<'.,.,', 'C_parser.y.rb', 7 21)2422 def _reduce_2 42(val, _values, result)2578 module_eval(<<'.,.,', 'C_parser.y.rb', 764) 2579 def _reduce_267(val, _values, result) 2423 2580 result = val[0].append!( val[2].val ) 2581 result 2582 end 2583 .,., 2584 2585 module_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 2424 2598 result 2425 2599 end -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/C_parser.y.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2018 by TOPPERS Project 7 7 #-- 8 # 上記著作権者は,以下の(1) ~(4)の条件を満たす場合に限り,本ソフトウェ8 # 上記著作権者は,以下の(1)〜(4)の条件を満たす場合に限り,本ソフトウェ 9 9 # ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 10 10 # 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. … … 48 48 # argument_expression_list(関数引数), assignment_expression(代入)がない 49 49 # 式の result は、すべて配列で第一要素が識別シンボル、第二要素以下が引数 50 # 51 # 2019/3/28 長島 下記のC99の構文に近づくよう変更 52 #(読めないヘッダーファイルがあったため) 53 # http://www.quut.com/c/ANSI-C-grammar-y-1999.html 54 # 元々のコメントと合わなくなっています 50 55 51 56 primary_expression 52 57 : namespace_identifier 53 58 { result = [ :IDENTIFIER, val[0] ] } #1ok 54 59 # : IDENTIFIER # mikan namespace への対応 … … 58 63 # | FALSE 59 64 # { result = [ :BOOL_CONSTANT, false ] } 60 65 | INTEGER_CONSTANT 61 66 { result = [ :INTEGER_CONSTANT, val[0] ] } 62 67 | FLOATING_CONSTANT 63 68 { result = [ :FLOATING_CONSTANT, val[0] ] } 64 69 | OCTAL_CONSTANT 65 70 { result = [ :OCTAL_CONSTANT, val[0] ] } 66 71 | HEX_CONSTANT 67 72 { result = [ :HEX_CONSTANT, val[0] ] } 68 73 | CHARACTER_LITERAL 69 74 { result = [ :CHARACTER_LITERAL, val[0] ] } 70 75 | string_literal_list 71 76 { result = [ :STRING_LITERAL_LIST, val[0] ] } 72 77 | '(' expression ')' 73 78 { result = [ :PARENTHESES, val[1].get_elements ] } 74 79 75 80 string_literal_list 76 81 : STRING_LITERAL 77 82 { result = [val[0]] } 78 83 | string_literal_list STRING_LITERAL 79 84 { result << val[1] } 80 85 81 86 # 関数呼び出しと後置インクリメント、デクリメント演算子がない 82 87 postfix_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 ']' 87 90 { 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 89 95 { result = [ :OP_DOT, val[0], val[2] ] } 90 96 | postfix_expression '->' IDENTIFIER 91 97 { 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 103 argument_expression_list 104 : assignment_expression 105 | argument_expression_list ',' assignment_expression 99 106 100 107 101 108 # 前置インクリメント、デクリメント演算子がない 102 109 unary_expression 103 104 110 : postfix_expression 111 | unary_operator cast_expression 105 112 { result = [ val[0], val[1] ] } 106 113 | SIZEOF unary_expression 107 114 { result = [ :OP_SIZEOF_EXPR, val[1] ] } 108 115 | SIZEOF '(' type_name ')' 109 116 { result = [ :OP_SIZEOF_TYPE, val[1] ] } 110 117 | '++' unary_expression { result = val[1] } # ++, -- は無視する … … 112 119 113 120 unary_operator 114 115 116 117 118 119 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 } 120 127 121 128 cast_expression 122 123 129 : unary_expression 130 | '(' type_name ')' cast_expression 124 131 { result = [ :CAST, val[1], val[3] ] } 125 132 126 133 multiplicative_expression 127 128 134 : cast_expression 135 | multiplicative_expression '*' cast_expression 129 136 { result = [ :OP_MULT, val[0], val[2] ] } 130 137 | multiplicative_expression '/' cast_expression 131 138 { result = [ :OP_DIV, val[0], val[2] ] } 132 139 | multiplicative_expression '%' cast_expression 133 140 { result = [ :OP_REMAIN, val[0], val[2] ] } 134 141 135 142 additive_expression 136 137 143 : multiplicative_expression 144 | additive_expression '+' multiplicative_expression 138 145 { result = [ :OP_ADD, val[0], val[2] ] } 139 146 | additive_expression '-' multiplicative_expression 140 147 { result = [ :OP_SUB, val[0], val[2] ] } 141 148 142 149 shift_expression 143 144 150 : additive_expression 151 | shift_expression '<<' additive_expression 145 152 { result = [ :OP_LSFT, val[0], val[2] ] } 146 153 | shift_expression '>>' additive_expression 147 154 { result = [ :OP_RSFT, val[0], val[2] ] } 148 155 149 156 relational_expression 150 151 157 : shift_expression 158 | relational_expression '<' shift_expression 152 159 { result = [ :OP_LT, val[0], val[2] ] } 153 160 | relational_expression '>' shift_expression 154 161 { result = [ :OP_GT, val[0], val[2] ] } 155 162 | relational_expression '<=' shift_expression 156 163 { result = [ :OP_LE, val[0], val[2] ] } 157 164 | relational_expression '>=' shift_expression 158 165 { result = [ :OP_GE, val[0], val[2] ] } 159 166 160 167 equality_expression 161 162 168 : relational_expression 169 | equality_expression '==' relational_expression 163 170 { result = [ :OP_EQ, val[0], val[2] ] } 164 171 | equality_expression '!=' relational_expression 165 172 { result = [ :OP_NE, val[0], val[2] ] } 166 173 167 174 and_expression 168 169 175 : equality_expression 176 | and_expression '&' equality_expression 170 177 { result = [ :OP_AND, val[0], val[2] ] } 171 178 172 179 exclusive_or_expression 173 174 180 : and_expression 181 | exclusive_or_expression '^' and_expression 175 182 { result = [ :OP_EOR, val[0], val[2] ] } 176 183 177 184 inclusive_or_expression 178 179 185 : exclusive_or_expression 186 | inclusive_or_expression '|' exclusive_or_expression 180 187 { result = [ :OP_OR, val[0], val[2] ] } 181 188 182 189 logical_and_expression 183 184 190 : inclusive_or_expression 191 | logical_and_expression '&&' inclusive_or_expression 185 192 { result = [ :OP_LAND, val[0], val[2] ] } 186 193 187 194 logical_or_expression 188 189 195 : logical_and_expression 196 | logical_or_expression '||' logical_and_expression 190 197 { result = [ :OP_LOR, val[0], val[2] ] } 191 198 192 199 conditional_expression 193 194 200 : logical_or_expression 201 | logical_or_expression '?' expression ':' conditional_expression 195 202 { result = [ :OP_CEX, val[0], val[2].get_elements, val[4] ] } 196 203 197 198 # コンマ演算子が使えない 204 assignment_expression 205 : conditional_expression 206 | unary_expression assignment_operator assignment_expression 207 208 assignment_operator 209 : '=' 210 | '+=' 211 | '-=' 212 | '*=' 213 | '/=' 214 | '%=' 215 | '<<=' 216 | '>>=' 217 | '&=' 218 | '|=' 219 | '^=' 220 199 221 expression 200 : conditional_expression222 : assignment_expression 201 223 { 202 224 result = Expression.new( val[0] ) 203 225 # result.print 204 226 } 227 | expression ',' assignment_expression 228 { 229 result = Expression.new( val[2] ) # ',' の後ろを採用 230 } 205 231 206 232 constant_expression 207 233 : conditional_expression 208 234 { 209 235 result = Expression.new( val[0] ) … … 218 244 } 219 245 220 221 222 246 # Types 223 247 ########################## 宣言 ########################## … … 227 251 # K&Rとの違い: storage classが指定できない、型が省略できない 228 252 declaration 229 230 # : type_specifier_qualifier_list init_declarator_list ';'253 : declaration_specifiers init_declarator_list ';' 254 # : specifier_qualifier_list init_declarator_list ';' 231 255 232 256 # declaration_specifiersは関数のパラメータで使われるが、 233 # type_specifier_qualifier_listで十分かもしれない257 # specifier_qualifier_listで十分かもしれない 234 258 235 259 declaration_specifiers 236 : storage_class 260 : storage_class_specifier 237 261 { 238 262 result = CIntType.new( -3 ) # storage class は無視 239 263 } 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 242 274 { 243 275 result = CIntType.new( -3 ) 244 276 result.set_qualifier val[0] 245 277 } 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 255 279 { 256 280 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 260 285 261 286 init_declarator_list 262 287 : init_declarator 263 288 { result = [val[0]] } 264 289 | init_declarator_list ',' init_declarator 265 290 { result << val[2] } 266 291 267 292 init_declarator 268 269 293 : declarator 294 | declarator '=' initializer 270 295 { val[0].set_initializer( val[2] ) } 271 296 297 storage_class_specifier 298 : EXTERN 299 | STATIC 300 | AUTO 301 | REGISTER 302 272 303 type_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 287 319 { 288 320 set_no_type_name true … … 290 322 result.set_sign :SIGNED 291 323 } 292 324 | UNSIGNED 293 325 { 294 326 set_no_type_name true … … 296 328 result.set_sign :UNSIGNED 297 329 } 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 ) } 298 340 299 341 # mikan K&Rのstruct_or_union_specifierに相当するが、unionは使えない, bit field にも対応しない 300 342 struct_specifier # mikan 301 343 # : STRUCT struct_tag '{' 302 344 : struct_term struct_tag '{' 303 345 { StructType.set_define( true ) } 304 346 struct_declaration_list '}' 305 347 { 306 348 StructType.end_of_parse … … 308 350 } 309 351 # | STRUCT 310 352 | struct_term 311 353 { 312 354 result = CStructType.new() 313 355 StructType.set_define( true ) 314 356 } 315 357 '{' struct_declaration_list '}' 316 358 { 317 359 StructType.end_of_parse … … 319 361 } 320 362 # | STRUCT struct_tag # mikan struct_tag は namespace 対応が必要 321 363 | struct_term struct_tag # mikan struct_tag は namespace 対応が必要 322 364 { 323 365 StructType.set_define( false ) … … 327 369 328 370 struct_term 329 371 : STRUCT { set_no_type_name true } 330 372 331 373 struct_declaration_list 332 333 374 : struct_declaration 375 | struct_declaration_list struct_declaration 334 376 335 377 struct_tag: 336 378 IDENTIFIER 337 379 { 338 380 result = CStructType.new( val[0].val ) … … 342 384 # ポインタ修飾子を追加 343 385 struct_declaration 344 345 # : type_specifier_qualifier_list struct_declarator_list ';'386 : declaration_specifiers struct_declarator_list ';' 387 # : specifier_qualifier_list struct_declarator_list ';' 346 388 { 347 389 val[1].each { |i| # i: Decl … … 353 395 result = val[1] 354 396 } 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 ';' # 無名 357 410 358 411 … … 360 413 # K&Rのspecifier_qualifier_listと同じ 361 414 # 名前がまぎらわしかったのでtype_を付けた 362 type_specifier_qualifier_list 363 : type_specifier 364 | type_specifier type_specifier_qualifier_list 415 specifier_qualifier_list 416 : type_specifier specifier_qualifier_list 365 417 { 366 418 result = val[1].merge val[0] 367 419 } 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 369 427 { 370 428 result = CIntType.new( -3 ) 371 429 result.set_qualifier val[0] 372 430 } 373 | type_qualifier type_specifier_qualifier_list374 {375 val[1].set_qualifier val[0]376 result = val[1]377 }378 431 379 432 struct_declarator_list 380 433 : struct_declarator 381 434 { result = [ val[0] ] } 382 435 | struct_declarator_list ',' struct_declarator 383 436 { result << val[2] } 384 437 385 438 # ビットフィールドは使えない 386 439 struct_declarator 387 388 389 440 : declarator 441 # | ':' constant_expression 442 # | declarator ':' constant_expression 390 443 391 444 union_specifier … … 393 446 # | UNION '{' union_declaration_list '}' 394 447 # | UNION union_tag # mikan struct_tag は namespace 対応が必要 395 396 397 448 : union_term union_tag '{' union_declaration_list '}' 449 | union_term '{' union_declaration_list '}' 450 | union_term union_tag # mikan struct_tag は namespace 対応が必要 398 451 399 452 union_term 400 453 : UNION { set_no_type_name true } 401 454 402 455 union_declaration_list 403 404 456 : union_declaration 457 | union_declaration_list union_declaration 405 458 406 459 union_tag: … … 408 461 409 462 union_declaration 410 463 : declaration_specifiers union_declarator_list ';' 411 464 | union_specifier ';' # 無名 412 465 | struct_specifier ';' # 無名 413 466 414 467 union_declarator_list 415 : union_declarator 416 | union_declarator_list ',' union_declarator 417 418 # ビットフィールドは使えない 468 : union_declarator 469 | union_declarator_list ',' union_declarator 470 419 471 union_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 476 enum_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 437 485 438 486 enumerator_list 439 440 487 : enumerator 488 | enumerator_list ',' enumerator 441 489 442 490 enumerator 443 444 491 : IDENTIFIER 492 | IDENTIFIER '=' constant_expression 445 493 446 494 type_qualifier 447 : CONST { result = :CONST } 448 | VOLATILE { result = :VOLATILE } 495 : CONST 496 { result = :CONST } 497 | RESTRICT 498 | VOLATILE 499 { result = :VOLATILE } 500 501 function_specifier 502 : __INLINE__ 503 | INLINE 504 | __INLINE 505 | CINLINE 449 506 450 507 declarator 451 508 : pointer direct_declarator 452 509 { 453 510 val[1].set_type( val[0] ) 454 511 result = val[1] 455 512 } 456 457 513 | direct_declarator 514 | pointer TYPE_NAME # 関数ポインタの typedef が二重定義の場合 458 515 { 459 516 result = Decl.new( val[1].val ) … … 462 519 463 520 direct_declarator # mikan 464 521 : IDENTIFIER 465 522 { result = Decl.new( val[0].val ) } 466 523 | '(' declarator ')' 467 524 { result = val[1] } 468 525 | direct_declarator '[' constant_expression ']' 469 526 { 470 527 val[0].set_type( CArrayType.new( val[2] ) ) 471 528 result = val[0] 472 529 } 473 530 | direct_declarator '[' ']' 474 531 { 475 532 val[0].set_type( CArrayType.new ) 476 533 result = val[0] 477 534 } 478 535 | direct_declarator '(' parameter_type_list ')' 479 536 { 480 537 # Generator.warning( "W6001 need 'void' for no parameter" ) … … 482 539 result = val[0] 483 540 } 484 485 # | direct_declarator '(' identifier_list ')' # これは何のために必要? 060211 486 | direct_declarator '(' ')' 541 | direct_declarator '(' identifier_list ')' # これは何のために必要? 060211 542 | direct_declarator '(' ')' 487 543 { 488 544 # Generator.warning( "W6002 need 'void' for no parameter" ) … … 492 548 493 549 pointer 494 550 : '*' 495 551 { result = CPtrType.new } 496 | '*' type_qualifier 552 | '*' type_qualifier_list 497 553 { 498 554 result = CPtrType.new 499 555 result.set_qualifier( val[1] ) 500 556 } 501 557 | '*' pointer 502 558 { 503 559 val[1].set_type(CPtrType.new) 504 560 result = val[1] 505 561 } 506 | '*' type_qualifierpointer562 | '*' type_qualifier_list pointer 507 563 { 508 564 ptrtype = CPtrType.new … … 512 568 } 513 569 570 type_qualifier_list 571 : type_qualifier 572 | type_qualifier_list type_qualifier 514 573 515 574 parameter_type_list 516 517 575 : parameter_list 576 | parameter_list ',' '.' '.' '.' 518 577 # mikan 可変長パラメータ, ... の間のスペースが許される(手抜き) 519 578 520 579 parameter_list 521 580 : parameter_declaration 522 581 # { result = ParamList.new( val[0] ) } 523 582 | parameter_list ',' parameter_declaration 524 583 # { 525 584 # val[0].add_param( val[2] ) … … 530 589 # パラメータ修飾子を追加 531 590 parameter_declaration 532 591 : declaration_specifiers declarator 533 592 # { 534 593 # decl = ParamDecl.new( val[1], val[0], [] ) … … 545 604 # result = nil 546 605 # } 547 548 549 550 551 #identifier_list # 060211 不用になった552 #: IDENTIFIER553 #| identifier_list ',' IDENTIFIER606 | declaration_specifiers abstract_declarator # 仮引数なし 607 | declaration_specifiers # 仮引数なし 608 609 610 identifier_list # 060211 不用になった 611 : IDENTIFIER 612 | identifier_list ',' IDENTIFIER 554 613 555 614 type_name 556 : type_specifier_qualifier_list557 | type_specifier_qualifier_list abstract_declarator615 : specifier_qualifier_list 616 | specifier_qualifier_list abstract_declarator 558 617 559 618 abstract_declarator # mikan 560 561 562 619 : pointer 620 | direct_abstract_declarator 621 | pointer direct_abstract_declarator 563 622 564 623 direct_abstract_declarator 565 566 567 | '[' constant_expression ']'568 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 | '(' ')' 571 630 { 572 631 Generator.warning( "W6003 need 'void' for no parameter" ) 573 632 } 574 575 633 | '(' parameter_type_list ')' 634 | direct_abstract_declarator '(' ')' 576 635 { 577 636 Generator.warning( "W6004 need 'void' for no parameter" ) 578 637 } 579 638 | direct_abstract_declarator '(' parameter_type_list ')' 580 639 581 640 # assignment_expressionをconstant_expressionに変更 582 641 initializer # mikan 583 : constant_expression642 : assignment_expression 584 643 { result = val[0] } 585 644 | '{' initializer_list '}' 586 645 { result = val[1] } 587 646 | '{' initializer_list ',' '}' 588 647 { result = val[1] } 589 | C_EXP '(' STRING_LITERAL ')'648 | C_EXP '(' STRING_LITERAL ')' 590 649 { result = C_EXP.new( val[2] ) } 591 650 592 651 initializer_list 593 652 : initializer 594 653 { 595 654 result = [ val[0] ] 596 655 } 597 656 | initializer_list ',' initializer 598 657 { 599 658 val[0] << val[2] … … 606 665 #トップレベルの構文規則 607 666 C_parser 608 609 667 : 668 | C_parser extension_statement 610 669 611 670 extension_statement 612 :statement613 | EXTENSIONstatement614 615 statement616 617 618 619 620 621 622 671 : cdl_statement 672 | EXTENSION cdl_statement 673 674 cdl_statement 675 : typedef 676 | func_def 677 | enum_specifier ';' 678 | struct_specifier ';' 679 | declaration 680 | ';' 681 | error # エラー回復ポイント 623 682 624 683 typedef 625 : TYPEDEF type_specifier_qualifier_list declarator_list ';'684 : TYPEDEF specifier_qualifier_list declarator_list ';' 626 685 { 627 686 val[2].each{ |i| … … 633 692 634 693 declarator_list 635 694 : declarator 636 695 { result = [ val[0] ] } 637 696 | declarator_list ',' declarator 638 697 { result << val[2] } 639 698 640 699 func_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 702 statement 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 714 labeled_statement 715 : IDENTIFIER ':' statement 716 | CASE constant_expression ':' statement 717 | DEFAULT ':' statement 718 719 compound_statement 720 : '{' '}' 721 | '{' block_item_list '}' 722 723 block_item_list 724 : block_item 725 | block_item_list block_item 726 727 block_item 728 : declaration 729 | statement 730 731 expression_statement 732 : ';' 733 | expression ';' 659 734 660 735 ifstatement 661 : IF '(' expression ')' infunc_statement 662 | IF '(' expression ')' infunc_statement ELSE infunc_statement 736 : IF '(' expression ')' statement 737 | IF '(' expression ')' statement ELSE statement 738 739 switchstatement 740 : SWITCH '(' expression ')' compound_statement 663 741 664 742 whilestatement 665 : WHILE '(' expression ')' infunc_statement743 : WHILE '(' expression ')' statement 666 744 667 745 dowhilestatement 668 : DO infunc_statement WHILE '(' expression ')' ';'746 : DO statement WHILE '(' expression ')' ';' 669 747 670 748 forstatement 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 754 jump_statement 755 : GOTO IDENTIFIER ';' 756 | CONTINUE ';' 757 | BREAK ';' 758 | RETURN ';' 759 | RETURN expression ';' 717 760 718 761 namespace_identifier 719 720 721 762 : IDENTIFIER { result = NamespacePath.new( val[0].val, false ) } 763 | '::' IDENTIFIER { result = NamespacePath.new( val[1].val, true ) } 764 | namespace_identifier '::' IDENTIFIER 722 765 { result = val[0].append!( val[2].val ) } 723 766 767 asm_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 724 781 end 725 782 726 783 ---- inner 727 784 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] 938 1002 #print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}: type_name'\n" ) 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 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 ] 1012 1076 #print "b_no_type_name=#{b_no_type_name} #{locale[0]}: line #{locale[1]}\n" 1013 1014 1077 @b_no_type_name = b_no_type_name 1078 end 1015 1079 1016 1080 ---- footer -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/bnf.tab.rb
r337 r374 284 284 string += line 285 285 # この位置では 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" 287 287 @@n_error += 1 288 288 end … … 325 325 b_in_string = true 326 326 # この位置では 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" 328 328 @@n_error += 1 329 329 # 山括弧で囲まれた文字列 330 when /\A<[0-9A-Za-z_\. \/]+>/ # AB: angle bracke 330 # when /\A<[0-9A-Za-z_\. \/]+>/ # AB: angle bracke 331 when /\A<(?:[^>\\]|\\.)*>/ # これはうまく行くようだ 331 332 @q << [:AB_STRING_LITERAL, Token.new($&, file, lineno, col)] 332 333 # 行コメント … … 458 459 end 459 460 if locale then 460 Console.puts " error: #{locale[0]}: line #{locale[1]}#{msg}"461 Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: error: #{msg}" 461 462 else 462 463 Console.puts "error: #{msg}" … … 491 492 end 492 493 if locale then 493 Console.puts " warning: #{locale[0]}: line #{locale[1]}#{msg}"494 Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: warning: #{msg}" 494 495 else 495 496 Console.puts "warning: #{msg}" … … 524 525 end 525 526 if locale then 526 Console.puts " info: #{locale[0]}: line #{locale[1]}#{msg}"527 Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: info: #{msg}" 527 528 else 528 529 Console.puts "info: #{msg}" … … 589 590 590 591 clist = [ 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', 594 595 '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', 649 706 '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', 722 730 '29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,', 723 731 ',,,,,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', 734 740 '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 '4 6,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22',737 '2 3,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48',738 '4 9,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25',739 '2 6,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', 740 746 ',,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26', 741 747 '27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,', 742 748 ',,,,,,,,,,,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',758 749 '29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14', 759 750 '15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,,', 760 751 ',,,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) 763 764 idx = 0 764 765 clist.each do |str| … … 770 771 771 772 clist = [ 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', 779 790 '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', 873 833 '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', 904 909 '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', 909 911 '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', 914 938 '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', 942 949 '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', 948 953 '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) 960 961 idx = 0 961 962 clist.each do |str| … … 967 968 968 969 racc_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, 971 972 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 972 nil, nil, nil, nil, nil, nil, 1340, nil, 1985, nil,973 32 95, 123, nil, nil, nil, nil, nil, nil, nil, nil,974 nil, nil, nil, nil, 218 2, 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, 1 480, nil, nil, 1539, nil, 1663, 1133, 285, 1177,984 2 340, 1531, 1520, nil, 27, nil, 2873, 45, nil, 1495,985 1 520, 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, 1 232, 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 1 157, nil, 1124, nil, 3254, 1665, 1017, nil, nil, nil,994 2578, 2755, nil, 592, 612, nil, 1131, 414, 149, nil,995 1 324, nil, 248, nil, 332, 814, 1135, 271, nil, 599,996 nil, 1 102, 1119, nil, 1081, nil, 1079, nil, 430, nil,997 1 069, 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, 15 03, 829, 811, nil, 1367, nil, 1300, 1253, 1208,1004 1 155, 1110, 993, 971, 949, 926, 857, 787, 720, 695,1005 2191, 2143, 2121, 2051, 2029, 2007, 447, nil, 811, nil,1006 nil, nil, 24 60, 1321, nil, 342, nil, nil, nil, nil,1007 804, 792, 788, 770, 754, nil, 2932, nil, nil, 806,1008 nil, nil, 3 30, 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, 1 911, 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 8 61, 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 1 109, nil, 996, 77, nil, 1893, -11, 130, 1108, nil,1027 484, 1617, 2401, 1159, 1937, nil, 1179, nil, 1178, nil,1028 nil, 1 867, nil, nil, nil, nil, 14, 26, 1211, 356,1029 1 222, nil, 1079, nil, 1234, 1235, 1237, 1250, 1252, 448,1030 nil, 1198, nil, 0, nil, nil, 1277, nil, nil, 1279,1031 nil, nil, 3 459, nil, nil, 346, 524, nil, nil, nil,1032 12, 79, 1272, nil, 1300, nil, 1305, 1286, 1289, nil,1033 1 319, 1326, 25, 1304, 1305, nil, 1337, nil, 1315, nil,1034 nil, 1 231, nil, 465, nil, nil, nil, 577, 1337, nil,1035 nil, nil, 1 364, 1365, 1256, 1350, 1377, nil, 1398, 2235,1036 nil, 1 426, 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 1 457, 1500, nil, 24, nil, 3500, 1345, 1448, nil, 3377,1040 1 275, 1523, nil, nil, 1231, nil, 496, nil, 1540, 1063,1041 384, 76, nil, nil, nil, 1 521, nil, 1549, nil, 1041,1042 1 437, 1544, nil, nil, nil, nil, nil, nil, nil, 888,1043 nil, nil, 10 26, 1049, nil, nil, 1595, nil, 1018, 1594,1044 nil, 548, nil, nil, nil, 1587, 262, nil, nil, nil,1045 1 591, 1626, nil, 1632, 1632, nil, 1634, 1613, 1614, 1641,1046 1 531, 1656, 1633, 1674, nil, 1648, 1683, 75, 352, nil,1047 1 686, 1678, 115, 1665, 344, nil, nil, nil, nil, nil,1048 nil, nil, nil, 1 729, nil, nil, 834, 812, nil, 1742,1049 nil, 5 47, nil, nil, nil, nil, 765, nil, 330, nil,1050 1 753, 2213, 229, nil, 1783, 1784, 1672, 1761, nil, nil,1051 nil, 1 674, 1771, 2165, 8, nil, nil, 1322, 1791, nil,1052 nil, nil, nil, 1824, 544, 2099, 1828, 1815, 2073, 89,1053 1 819, 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, 53 9, 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, 1060 1061 nil ] 1061 1062 … … 1200 1201 665, nil, nil, nil, nil, nil, 671, 596, 597, 588, 1201 1202 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, 1203 1204 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1204 1205 nil, nil, nil, nil, nil, nil, nil, nil, 664, nil, … … 1216 1217 nil, nil, nil, nil, nil, nil, nil, nil, nil, 696, 1217 1218 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, 1219 1220 nil, 769, nil, nil, nil, nil, nil, nil, nil, nil, 1220 1221 nil, 894, nil, nil, nil, nil, nil, nil, nil, nil, … … 1280 1281 23, nil, nil, nil, nil, nil, 23, 4, 4, 23, 1281 1282 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, 1283 1284 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1284 1285 nil, nil, nil, nil, nil, nil, nil, nil, 47, nil, … … 1296 1297 nil, nil, nil, nil, nil, nil, nil, nil, nil, 25, 1297 1298 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, 1299 1300 nil, 47, nil, nil, nil, nil, nil, nil, nil, nil, 1300 1301 nil, 6, nil, nil, nil, nil, nil, nil, nil, nil, … … 2943 2944 def _reduce_104(val, _values, result) 2944 2945 # tag が無い場合、内部名を与える 2945 result = StructType.new( :" $TAG_#{@@no_struct_tag_num}" )2946 result = StructType.new( :"TAG__#{@@no_struct_tag_num}__" ) 2946 2947 @@no_struct_tag_num += 1 2947 2948 StructType.set_define( true ) … … 3749 3750 module_eval(<<'.,.,', 'bnf.y.rb', 802) 3750 3751 def _reduce_233(val, _values, result) 3751 result = [val[0] .val]3752 result = [val[0]] 3752 3753 result 3753 3754 end … … 3756 3757 module_eval(<<'.,.,', 'bnf.y.rb', 804) 3757 3758 def _reduce_234(val, _values, result) 3758 result << val[2] .val3759 result << val[2] 3759 3760 result 3760 3761 end -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/bnf.y.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 6by TOPPERS Project6 # Copyright (C) 2008-2018 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 379 379 { 380 380 # tag が無い場合、内部名を与える 381 result = StructType.new( :" $TAG_#{@@no_struct_tag_num}" )381 result = StructType.new( :"TAG__#{@@no_struct_tag_num}__" ) 382 382 @@no_struct_tag_num += 1 383 383 StructType.set_define( true ) … … 800 800 801 801 region_name_list 802 : IDENTIFIER803 { result = [val[0] .val] }804 | region_name_list ',' IDENTIFIER805 { result << val[2] .val}802 : namespace_identifier 803 { result = [val[0]] } 804 | region_name_list ',' namespace_identifier 805 { result << val[2] } 806 806 807 807 const_statement … … 1807 1807 string += line 1808 1808 # この位置では 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" 1810 1810 @@n_error += 1 1811 1811 end … … 1848 1848 b_in_string = true 1849 1849 # この位置では 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" 1851 1851 @@n_error += 1 1852 1852 # 山括弧で囲まれた文字列 1853 when /\A<[0-9A-Za-z_\. \/]+>/ # AB: angle bracke 1853 # when /\A<[0-9A-Za-z_\. \/]+>/ # AB: angle bracke 1854 when /\A<(?:[^>\\]|\\.)*>/ # これはうまく行くようだ 1854 1855 @q << [:AB_STRING_LITERAL, Token.new($&, file, lineno, col)] 1855 1856 # 行コメント … … 1981 1982 end 1982 1983 if locale then 1983 Console.puts " error: #{locale[0]}: line #{locale[1]}#{msg}"1984 Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: error: #{msg}" 1984 1985 else 1985 1986 Console.puts "error: #{msg}" … … 2014 2015 end 2015 2016 if locale then 2016 Console.puts " warning: #{locale[0]}: line #{locale[1]}#{msg}"2017 Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: warning: #{msg}" 2017 2018 else 2018 2019 Console.puts "warning: #{msg}" … … 2047 2048 end 2048 2049 if locale then 2049 Console.puts " info: #{locale[0]}: line #{locale[1]}#{msg}"2050 Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: info: #{msg}" 2050 2051 else 2051 2052 Console.puts "info: #{msg}" -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/componentobj.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 7by TOPPERS Project6 # Copyright (C) 2008-2019 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 149 149 end 150 150 151 set_descriptor_list151 # set_descriptor_list ## 152 152 153 153 if @generate then … … 364 364 end 365 365 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 366 376 #== Signature# 引数で参照されている Descriptor 型のリストを作成する 367 377 def set_descriptor_list … … 538 548 # @ct_factory_list:: Factory[] : celltype factory 539 549 # @cell_list:: Cell[] : 定義のみ (V1.0.0.2 以降) 550 # @ordered_cell_list:: Cell[] : ID 順に順序付けされたセルリスト、最適化以降有効 (リンク単位ごとに生成されなおす) 540 551 # @singleton:: bool 541 552 # @idx_is_id:: bool 542 553 # @idx_is_id_act:: bool: actual value 554 # @b_need_ptab:: bool: true if having cells in multi-domain 543 555 # @active:: bool 544 556 # @b_reuse:: bool : reuse 指定されて import された(template 不要) … … 654 666 if $idx_is_id then 655 667 @idx_is_id = true 668 @idx_is_id_act = true 669 @b_need_ptab = true 656 670 else 657 671 @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 660 675 661 676 Namespace.new_celltype( self ) … … 700 715 end 701 716 702 check_dynamic_join717 # check_dynamic_join ## 703 718 704 719 @@current_object = nil … … 886 901 @idx_is_id = true 887 902 @idx_is_id_act = true 903 @b_need_ptab = true 888 904 when :ACTIVE 889 905 @active = true … … 899 915 if @singleton then 900 916 @idx_is_id_act = false 917 @b_need_ptab = false 901 918 end 902 919 end … … 999 1016 end 1000 1017 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 1001 1028 #=== Celltype#dynamic の適合性チェック 1002 1029 def check_dynamic_join 1030 return if ! $verbose 1003 1031 @port.each{ |port| 1004 1032 signature = port.get_signature … … 1038 1066 end 1039 1067 end 1040 cdl_warning( 'W9999 "$1" cannot handle Descriptor "$2" inf romation 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 ) 1041 1069 } 1042 1070 end … … 1143 1171 # 呼び口(ただし、最適化で不要となるものは除く) 1144 1172 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 1153 1183 end 1154 1184 … … 1231 1261 def idx_is_id_act? 1232 1262 @idx_is_id_act 1263 end 1264 1265 def multi_domain? 1266 @b_need_ptab 1233 1267 end 1234 1268 … … 1353 1387 # 逆require ポートに対して複数の結合がないかチェックする 1354 1388 # @generate:: [ Symbol, String, Plugin ] = [ PluginName, option, Plugin ] Plugin は生成後に追加される 1389 # @b_post_code_generated:: Bool: true if generated in tmp_plugin_post_code.cdl 1355 1390 # 1356 1391 # composite のためインスタンス変数 … … 1375 1410 # @id:: Integer : コード生成直前に設定 (プロトタイプ宣言の場合は -1 のまま放置) 1376 1411 # @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 が参照れた 1378 1415 1379 1416 =begin … … 1459 1496 @referenced_port_list = {} 1460 1497 @restrict_list = {} 1498 @restrict_list2 = {} 1499 @b_restrict_referenced = false 1500 @b_post_code_generated = false 1461 1501 1462 1502 @cell_list = {} … … 1803 1843 set_specifier_list( Generator.get_statement_specifier ) 1804 1844 end 1845 if TECSGEN.post_coded? 1846 @b_post_code_generated = true 1847 end 1805 1848 set_f_def f_def 1806 1849 … … 1820 1863 if ! @in_composite then 1821 1864 # if @celltype.instance_of? Celltype then 1865 if @celltype then # composite でも呼びだす, エラー時 nil 1822 1866 @celltype.new_cell self 1823 #end1867 end 1824 1868 @@cell_list << self 1825 1869 end … … 2132 2176 end 2133 2177 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 2134 2192 # composite cell の port に対応する内部の cell の port の名前(リンク時に必要な名前) 2135 2193 def get_real_global_name port_name … … 2219 2277 2220 2278 # セルタイプ内で port_name の CompositeCelltypeJoin を探す(コード生成段階では必ず見つかる) 2279 # print "get_real_cell: cell=#{@name} port=#{port_name}\n" 2280 # pp @cell_list 2221 2281 cj = @celltype.find_export( port_name ) 2222 2282 … … 2230 2290 end 2231 2291 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 2232 2301 2233 2302 #=== Cell# 受け口のport の参照カウントをアップする … … 2270 2339 return "#{@global_name}_#{port_name}" 2271 2340 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 2272 2353 end 2273 2354 … … 2520 2601 else 2521 2602 cell = j.get_rhs_cell2 2522 next if cell == nil # 右辺が見つからなかった.既にエラー2603 next if cell == nil || cell.get_celltype == nil # 右辺が見つからなかった.既にエラー 2523 2604 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 2524 2611 dbgPrint( "set_port_reference_count: #{@name}.#{j.get_name} => #{cell.get_name}.#{port.get_name}\n") 2525 2612 cell.port_referenced port … … 2966 3053 #=== Cell#restrict を追加 2967 3054 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 2975 3125 end 2976 3126 } 2977 3127 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 3017 3156 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 3036 3162 def show_tree( indent ) 3037 3163 indent.times { print " " } … … 3709 3835 end 3710 3836 3837 def get_global_name 3838 @global_name 3839 end 3840 3711 3841 def get_port_list 3712 3842 @port_list … … 3723 3853 def get_internal_allocator_list 3724 3854 @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 3725 3867 end 3726 3868 … … 3936 4078 else 3937 4079 # entry port optimize 3938 if $unopt then4080 if $unopt || $unopt_entry then 3939 4081 # 最適化なし 3940 4082 @b_VMT_useless = false # VMT 不要 (true の時 VMT を介することなく呼出す) … … 4260 4402 4261 4403 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 4263 4411 end 4264 4412 4265 4413 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 4267 4421 end 4268 4422 … … 4801 4955 if ! c.get_f_def then # Namespace の @cell_list にはプロトタイプが含まれるケースあり 4802 4956 if c.get_f_ref then 4803 c dl_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 ) 4804 4958 elsif $verbose then 4805 c dl_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 ) 4806 4960 end 4807 4961 else … … 4810 4964 # if c.get_f_ref == false && c.is_generate? && ct && ct.is_inactive? then 4811 4965 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 ) 4813 4970 end 4814 4971 end … … 5005 5162 end 5006 5163 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 5007 5176 def show_tree( indent ) 5008 5177 indent.times { print " " } … … 5601 5770 next_cell_nsp = @through_generated_list[ i + 1 ].get_cell_namespace_path 5602 5771 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 5603 5773 rescue Exception => evar 5604 5774 cdl_error( "S1124 $1: plugin function failed: \'get_through_entry_port_name\'" , plugin_name ) … … 5619 5789 next_cell = @cell 5620 5790 next_port_name = @port_name 5791 next_port_subscript = @rhs_subscript 5621 5792 5622 5793 if next_cell == nil then … … 5630 5801 # region から @cell_name.@port_name への through がないか探す 5631 5802 # 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 ) 5633 5804 # @through_list[i] と @region_through_list[i-cp_len] は同じ 5634 5805 # 共用しないようにするには、見つからなかったことにすればよい … … 5643 5814 plClass = load_plugin( plugin_name, ThroughPlugin ) 5644 5815 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 ) 5646 5817 end 5647 5818 else … … 5656 5827 # 生成したものを region(@through_list[i][3]) のリストに追加 5657 5828 # @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] ) 5659 5830 end 5660 5831 end … … 5690 5861 5691 5862 #=== 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 ) 5693 5864 5694 5865 through = @through_list[ i ] … … 5717 5888 5718 5889 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 ) 5720 5893 plugin_object.set_locale @locale 5721 5894 rescue Exception => evar … … 5912 6085 end 5913 6086 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 5915 6095 @rhs_subscript 5916 6096 end … … 5922 6102 # through 指定あり? 5923 6103 if @through_list[0] then 5924 # mikan through で生成したものが root namespace 限定5925 6104 # through で生成されたセルを探す 5926 # cell = Namespace.find( [ "::", @through_generated_list[0].get_cell_name.to_sym ] ) #15927 6105 cell = Namespace.find( @through_generated_list[0].get_cell_namespace_path ) #1 5928 6106 # cell のプラグインで生成されたポート名のポートを探す (composite なら内部の繋がるポート) … … 5931 6109 # ポートを返す(composite なら内部の繋がるポートを返す) 5932 6110 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 5933 6123 end 5934 6124 end … … 6568 6758 end 6569 6759 6570 #== Domain 6760 #== DomainType 6571 6761 # 6572 6762 # region の domain を記憶するクラス … … 6607 6797 return if pluginClass == nil 6608 6798 @plugin = pluginClass.new( @region, @name, @option ) 6799 @plugin.set_locale @locale 6609 6800 end 6610 6801 end … … 6624 6815 end 6625 6816 6626 #== Domain リージョンの Hash を得る6817 #== DomainType リージョンの Hash を得る 6627 6818 # @@domain_regions の説明参照 6628 6819 def self.get_domain_regions … … 6636 6827 def get_option 6637 6828 @option 6829 end 6830 6831 #== DomainType#ドメイン種別を得る 6832 #return::Symbol :kernel, :user, :OutOfDomain 6833 def get_kind 6834 @plugin.get_kind 6638 6835 end 6639 6836 … … 6697 6894 6698 6895 if @@domain_name then 6896 dbgPrint "Region=#{name} domain_type=#{@@domain_name} option=#{@@domain_option}\n" 6699 6897 domain_option = CDLString.remove_dquote @@domain_option.to_s 6700 6898 @domain_type = DomainType.new( self, @@domain_name, domain_option ) … … 6945 7143 end 6946 7144 7145 #== Region# ルートリージョン 7146 # ルートリージョンは、namespace のルートと同じインスタンス 7147 def selfget_root 7148 Namespace.get_root 7149 end 7150 6947 7151 def next_in_through_count 6948 7152 @in_through_count += 1 … … 6978 7182 #=== Region# through プラグインで、この region から cell_name.port_name へのプラグインオブジェクトを登録 6979 7183 # 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}" ] 6986 7196 end 6987 7197 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/ctypes.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 122 122 # TECS には long double を表現する手段がない (double80_t を定義すればよいか?) 123 123 # 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 125 126 return self 126 127 else … … 185 186 end 186 187 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 187 195 end 188 196 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/expression.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/generate.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 7by TOPPERS Project6 # Copyright (C) 2008-2019 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 122 122 123 123 class Namespace 124 @@domain_gen_factory_list = nil 124 125 def generate 125 126 … … 135 136 return 136 137 end 138 if instance_of? Region then 139 @@domain_gen_factory_list = {} # create hash 140 end 137 141 end 138 142 … … 141 145 gen_global_header 142 146 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 143 156 # signature のコードを生成 144 157 @signature_list.each { |s| … … 455 468 } 456 469 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" 458 471 if $generating_region == @@root_namespace then 459 472 f.print " rm -rf $(GEN_DIR)\n" … … 465 478 f.print "tecs : $(PRE_TECSGEN_TARGET) $(TIMESTAMP) $(POST_TECSGEN_TARGET)\n\n" 466 479 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" 468 481 # f.print " touch $(TIMESTAMP)\n\n" 469 470 482 else 471 483 f.print "tecs:\n" … … 473 485 end 474 486 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 475 527 f.print "# generic target for objs\n" 476 528 f.print "$(_TECS_OBJ_DIR)%.o : %.#{$c_suffix}\n" … … 492 544 ### Makefile.tecsgen の生成 493 545 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 587 EOT 494 588 495 589 f.print( "TECS_IMPORT_CDLS =" ) … … 546 640 DomainType.get_domain_regions.each{ |dt, regions| 547 641 # domain_type は一つのノードには、一つしかないので、このループは、必ず一回しか回らない 642 ### mikan 複数のノードがあり、異なる domain_type が指定される可能性はある 548 643 domain_regions = regions 549 644 domain_type = dt … … 588 683 f.print( "\n\n" ) 589 684 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" ) 591 719 f.print( "TECSGEN_COBJS = \\\n" ) 592 720 domain_regions.each{ |r| … … 622 750 623 751 ### 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" ) 625 753 domain_regions.each{ |r| 626 754 nsp = decideDomainNameProc.call( r ) … … 656 784 657 785 f.print( "# PLUGIN_SRCS: sources automatically generated by plugin\n" ) 786 f.print( "PLUGIN_CELLTYPE_SRCS = \\\n" ) 658 787 domain_regions.each{ |r| 659 788 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" ) 666 814 f.close 667 815 … … 779 927 @namespace_list.each{ |ns| 780 928 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 781 948 } 782 949 end … … 1023 1190 gen_ph_get_cellcb f 1024 1191 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" 1026 1197 # gen_ph_abstract_ep_des_type f 1027 1198 … … 1247 1418 def gen_ph_info f 1248 1419 1420 yn_multi_domain = "no" 1421 yn_multi_domain = "yes" if multi_domain? 1249 1422 yn_idx_is_id = "no" 1250 1423 yn_idx_is_id = "yes" if @idx_is_id … … 1255 1428 yn_rom = "no" 1256 1429 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? 1257 1434 yn_cb_init = "no" 1258 1435 yn_cb_init = "yes" if need_CB_initializer? … … 1263 1440 * celltype : #{@name} 1264 1441 * global name : #{@global_name} 1442 * multi-domain : #{yn_multi_domain} 1265 1443 * idx_is_id(actual) : #{yn_idx_is_id}(#{yn_idx_is_id_act}) 1266 1444 * 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} 1269 1447 * rom : #{yn_rom} 1270 1448 * CB initializer : #{yn_cb_init} … … 1595 1773 f.print( "#define #{@global_name}_GET_CELLCB(idx) ((void *)0)\n" ) 1596 1774 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" ) 1598 1776 else 1599 1777 f.print( "#define #{@global_name}_GET_CELLCB(idx) (idx)\n" ) … … 1799 1977 end 1800 1978 1801 def gen_ph_cp_fun_macro f 1802 if @n_call_port >0 then1979 def gen_ph_cp_fun_macro f, b_flow 1980 if @n_call_port >0 && b_flow == false then 1803 1981 f.printf( TECSMsg.get( :CPM_comment ) , "#_CPM_#" ) 1804 1982 end … … 1856 2034 1857 2035 # 関数名の出力(標準:受け口ディスクリプタから 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 1859 2039 # 標準コード 1860 2040 if @singleton then … … 1891 2071 1892 2072 # 受け口情報の出力(標準:受け口ディスクリプタ、最適化: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 1894 2075 # 標準コード 1895 2076 if @singleton then … … 1969 2150 p_cellcb = " #{@global_name}_CB *p_cellcb = p_that;\n" 1970 2151 delim = ", " 1971 cb = "p_ that#{inib}->"2152 cb = "p_cellcb#{inib}->" 1972 2153 end 1973 2154 … … 2616 2797 f.print "extern #{@global_name}_INIB #{@global_name}_SINGLE_CELL_INIB;\n" 2617 2798 end 2618 2619 # @ordered_cell_list.each{ |c|2620 # f.print "extern #{@global_name}_CB #{@global_name}_#{c.get_name}_CB;\n"2621 # }2622 2623 2799 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 2626 2819 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 2628 2826 end 2629 2827 end 2630 2828 2631 2829 def gen_ph_INIB_as_CB f 2632 2830 # ここは、手抜きである。本来なら INIB を出力すべき 2633 2831 if ! has_CB? && has_INIB? then 2634 2832 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 2637 2840 f.print "#define #{@global_name}_CB #{@global_name}_INIB\n" 2638 2841 f.print "#define tag_#{@global_name}_CB tag_#{@global_name}_INIB\n" … … 2658 2861 f.printf( TECSMsg.get( :FEC_comment ), "#_FEC_#" ) 2659 2862 2660 if @ idx_is_id_actthen2863 if @b_need_ptab then 2661 2864 amp = '' 2865 tab = 'ptab' 2662 2866 else 2663 2867 amp = '&' 2868 tab = 'tab' 2664 2869 end 2665 2870 f.print <<EOT 2666 2871 #define FOREACH_CELL(i,p_cb) \\ 2667 2872 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]; 2669 2874 2670 2875 #define END_FOREACH_CELL } … … 2799 3004 if @singleton then 2800 3005 f.print "\t#{that}_inib = &#{@global_name}_SINGLE_CELL_INIB;\n\n" 2801 elsif @ idx_is_id_act2802 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" 2803 3008 else 2804 3009 f.print "\t#{that}_inib = &#{@global_name}_INIB_tab[(i)];\n\n" … … 3397 3602 fs.each{ |r, f| f.print "#{@global_name}_INIB #{@global_name}_SINGLE_CELL_INIB = \n" } 3398 3603 indent = 0 3399 elsif ! @ idx_is_id_actthen3604 elsif ! @b_need_ptab then 3400 3605 fs.each{ |r, f| f.print "#{@global_name}_INIB #{@global_name}_INIB_tab[] = {\n" } 3401 3606 indent = 1 … … 3418 3623 3419 3624 print_indent( f, indent ) 3420 if @ idx_is_id_actthen3625 if @b_need_ptab then 3421 3626 f.print "const #{@global_name}_INIB #{name_array[5]} = " 3422 3627 end … … 3428 3633 unless @singleton then 3429 3634 # 1 つの cell INIB の終わり 3430 if @ idx_is_id_actthen3635 if @b_need_ptab then 3431 3636 f.print( "};\n\n" ) 3432 3637 else … … 3435 3640 end 3436 3641 } 3437 if ! @ idx_is_id_actthen3642 if ! @b_need_ptab then 3438 3643 fs.each{ |r, f| f.print( "};\n\n" ) } 3439 3644 end … … 3450 3655 fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_SINGLE_CELL_CB = \n" } 3451 3656 indent = 0 3452 elsif ! @ idx_is_id_actthen3657 elsif ! @b_need_ptab then 3453 3658 fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_CB_tab[] = {\n" } 3454 3659 indent = 1 … … 3471 3676 3472 3677 print_indent( f, indent ) 3473 if @ idx_is_id_actthen3678 if @b_need_ptab then 3474 3679 f.print "#{@global_name}_CB #{name_array[2]} = " 3475 3680 end … … 3493 3698 unless @singleton then 3494 3699 # 1 つの cell CB の終わり 3495 if @ idx_is_id_actthen3700 if @b_need_ptab then 3496 3701 f.print( "};\n\n" ) 3497 3702 else … … 3500 3705 end 3501 3706 } 3502 if ! @ idx_is_id_actthen3707 if ! @b_need_ptab then 3503 3708 fs.each{ |r, f| f.print( "};\n\n" ) } 3504 3709 end … … 3507 3712 fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_SINGLE_CELL_CB;\n" } 3508 3713 indent = 0 3509 elsif @ idx_is_id_actthen3714 elsif @b_need_ptab then 3510 3715 @ordered_cell_list.each{ |c| 3511 3716 next if ! c.is_generate? … … 3526 3731 def gen_cell_cb_tab f 3527 3732 indent = 0 3528 if @ idx_is_id_actthen3733 if @b_need_ptab then 3529 3734 if has_INIB? && ( $ram_initializer || ! has_CB? ) then 3530 3735 f.print "/* ID to INIB table #_INTAB_# */\n" … … 3537 3742 } 3538 3743 3539 f.print "#{@global_name}_INIB * #{@global_name}_INIB_tab[] ={\n"3744 f.print "#{@global_name}_INIB *const #{@global_name}_INIB_ptab[] ={\n" 3540 3745 @ordered_cell_list.each{ |c| 3541 3746 if c.is_generate? then # 生成対象か? … … 3557 3762 } 3558 3763 3559 f.print "#{@global_name}_CB * #{@global_name}_CB_tab[] ={\n"3764 f.print "#{@global_name}_CB *const #{@global_name}_CB_ptab[] ={\n" 3560 3765 @ordered_cell_list.each{ |c| 3561 3766 if c.is_generate? then # 生成対象か? … … 3586 3791 # name_array[9] = @global_name # celltype global name 3587 3792 # name_array[10] = cell.get_global_name # cell global name 3793 # name_array[11] = cell_INIB_proto #INIB name for proto type 3588 3794 3589 3795 def get_name_array( cell ) … … 3594 3800 cell_CB_proto = "#{@global_name}_SINGLE_CELL_CB" 3595 3801 cell_INIB_name = "#{@global_name}_SINGLE_CELL_INIB" 3802 cell_INIB_proto = cell_INIB_name 3596 3803 cell_ID = 0 3597 3804 else 3598 if ! @ idx_is_id_actthen3805 if ! @b_need_ptab then 3599 3806 index = cell.get_id - cell.get_celltype.get_id_base 3600 3807 cell_CB_name = "#{@global_name}_CB_tab[#{index}]" … … 3602 3809 cell_CB_proto = "#{@global_name}_CB_tab[]" 3603 3810 cell_INIB_name = "#{@global_name}_INIB_tab[#{index}]" 3811 cell_INIB_proto = "#{@global_name}_INIB_tab[]" 3604 3812 else 3605 3813 cell_CB_name = "#{cell.get_global_name}_CB" … … 3607 3815 cell_CB_proto = cell_CB_name 3608 3816 cell_INIB_name = "#{cell.get_global_name}_INIB" 3817 cell_INIB_proto = cell_INIB_name 3609 3818 end 3610 3819 cell_ID = cell.get_id 3611 end3612 if @idx_is_id_act then3613 cell_IDX = cell_ID3614 else3615 cell_IDX = "&#{cell_CB_name}"3616 3820 end 3617 3821 … … 3622 3826 else 3623 3827 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 3624 3834 end 3625 3835 … … 3636 3846 name_array[9] = @global_name # celltype global name 3637 3847 name_array[10] = cell.get_global_name # cell global name 3848 name_array[11] = cell_INIB_proto # INIB name for prototype 3638 3849 3639 3850 return name_array … … 3820 4031 c = j.get_rhs_cell # 呼び先セル 3821 4032 ct = c.get_celltype # 呼び先セルタイプ 4033 name_array = ct.get_name_array( c ) # 呼び先セルタイプで name_array を得る 3822 4034 if ct.has_INIB? || ct.has_CB? then 3823 name_array = ct.get_name_array( c ) # 呼び先セルタイプで name_array を得る3824 4035 f.printf( "%-40s /* %s #_CCP2_# */\n", "#{name_array[7]},", p.get_name ) 3825 4036 else … … 4107 4318 f = fs[ c.get_region.get_domain_root ] 4108 4319 4109 ct = c.get_celltype 4320 ct = c.get_celltype # ct = self でも同じ 4110 4321 jl = c.get_join_list 4322 name_array = get_name_array( c ) 4111 4323 4112 4324 port = ct.get_port_list … … 4143 4355 else 4144 4356 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" 4151 4364 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" 4157 4371 else 4158 4372 f.print " 0,\n" … … 4178 4392 else 4179 4393 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" 4186 4401 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" 4192 4408 else 4193 4409 f.print " 0,\n" … … 4550 4766 def generate_inline_template_code 4551 4767 return if @n_entry_port_inline == 0 4768 return if @b_reuse && ! $generate_all_template 4552 4769 if ! ( @plugin && @plugin.gen_ep_func? ) then 4553 4770 return if @b_reuse && ! $generate_all_template … … 4927 5144 # str に以下の置換を行う 4928 5145 #- $ct$ ⇒ セルタイプ名(ct) 4929 #- $cell$ ⇒ セル名(cell) cell が nil ならば 3つの置換は行われない5146 #- $cell$ ⇒ セル名(cell) cell が nil ならば以下の置換は行われない 4930 5147 #- $cb$ ⇒ CB の C 言語名(cb) 4931 5148 #- $cbp$ ⇒ CB へのポインタ(cbp) 4932 5149 #- $cb_proto$ ⇒ CB の C 言語名プロトタイプ宣言用(cb_proto) 4933 #- $id$ ⇒ ct_cell5150 #- $id$ ⇒ $ct$_$cell_global$ # ct_cell before or same V1.5.2 4934 5151 #- $idx$ ⇒ idx 4935 5152 #- $ID$ ⇒ id (整数の番号) 4936 5153 #- $ct_global$ ⇒ セルタイプ名(ct) 4937 #- $cell_global$ ⇒ セル名(cell) cell が nil ならば3つの置換は行われない5154 #- $cell_global$ ⇒ セル名(cell) 4938 5155 #- $$ ⇒ $ 4939 5156 def subst_name( str, name_array ) … … 4950 5167 4951 5168 str = str.gsub( /(^|[^\$])\$ct\$/, "\\1#{ct}" ) 5169 str = str.gsub( /(^|[^\$])\$ct_global\$/, "\\1#{ct_global}" ) 4952 5170 if cell then 4953 5171 str = str.gsub( /(^|[^\$])\$cell\$/, "\\1#{cell}" ) 4954 5172 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}" ) 4956 5175 str = str.gsub( /(^|[^\$])\$cb_proto\$/, "\\1#{cb_proto}" ) 4957 5176 str = str.gsub( /(^|[^\$])\$ID\$/, "\\1#{id}" ) 4958 5177 str = str.gsub( /(^|[^\$])\$idx\$/, "\\1#{idx}" ) 4959 5178 str = str.gsub( /(^|[^\$])\$cbp\$/, "\\1#{cbp}" ) 4960 str = str.gsub( /(^|[^\$])\$ct_global\$/, "\\1#{ct_global}" )4961 5179 str = str.gsub( /(^|[^\$])\$cell_global\$/, "\\1#{cell_global}" ) 4962 5180 end … … 5078 5296 end 5079 5297 end 5298 5299 class DomainType < Node 5300 def gen_factory 5301 # p "DomainType: gen_factory" 5302 @plugin.gen_factory 5303 end 5304 end -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/location.rb
r337 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/messages.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/optimize.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2018 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 178 178 179 179 def set_domain 180 domain_cells = {} 180 181 @cell_list.each{ |c| 181 182 if c.is_generate? then … … 191 192 @domain_roots[ dn ] = [ dr ] 192 193 end 194 if domain_cells[ dr ] then 195 domain_cells[ dr ] << c 196 else 197 domain_cells[ dr ] = [ c ] 198 end 193 199 end 194 200 } … … 196 202 @domain_roots.each{ |dn, drs| 197 203 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 = "" 200 207 drs.each{ |r| 201 dbgPrint " region=#{r.get_name}" 208 print delim, r.get_name 209 delim = ", " 202 210 } 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 } 204 221 end 205 222 } … … 212 229 # domain_type は一つのノードに一つしかないので、一つの要素を無条件で取り出す 213 230 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 219 239 end 220 240 } … … 228 248 end 229 249 250 optimize_call 251 if $unopt_entry == false then 252 optimize_entry 253 end 254 end 255 256 #=== Celltype#呼び口最適化 257 def optimize_call 230 258 @port.each{ |port| 231 259 next if port.get_port_type != :CALL … … 361 389 dbgPrint "#{port.get_name} : # of cells : #{port_cells.length} # of ports : #{port_ports.length}\n" 362 390 } 363 391 end 392 393 #=== Celltype#受け口最適化 394 # optimize_entry は、呼び口最適化の結果を使用している 395 def optimize_entry 364 396 # 受け口最適化の設定 365 397 @port.each{ |port| -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/plugin.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 160 160 # 識別子取得 161 161 if arg =~ /\A[a-zA-Z_]\w*/ then 162 ident = $~ 162 ident = $~.to_s # 163 163 arg = $' 164 164 else -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/pluginModule.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/syntaxobj.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 6by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 685 685 end 686 686 687 #=== Decl# print_flowinfo 688 def print_flowinfo file 689 if @kind == :VAR then 690 file.write "#{@identifier} " 691 end 692 end 693 687 694 def show_tree( indent ) 688 695 indent.times { print " " } -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tecsgen.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 250 250 Cell.create_reverse_join 251 251 252 DescriptorType.check_signature 253 Signature.set_descriptor_list 254 Celltype.check_dynamic_join 255 252 256 #0 set_definition_join は2回呼び出される(1回目) 253 257 dbgPrint( "## Checking all join\n") … … 450 454 end # finalize 451 455 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 452 520 def self.post_coded? 453 521 @@b_post_coded -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tecsinfo.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2017 by TOPPERS Project6 # Copyright (C) 2017-2018 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 49 49 #{indent0}region rTECSInfo { 50 50 EOT 51 # mikan 全部生成するのではなく、region 下のセルのセルタイプと、そこから参照されるシグニチャ、セルタイプに限定して出力する. 51 Type.reset_print_info 52 53 # mikan 全部生成するのではなく、region 下のセルのセルタイプと、そこから参照されるシグニチャ、セルタイプに限定して出力すべき 52 54 # しかし、意味解析後に出力するため、これは容易ではない.最適化とコード生成は、リンクルートごとに行われる. 53 55 Namespace.print_info f, indent … … 149 151 "#{tag.get_ID_str}_#{decl.get_name}", 150 152 "(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" 151 156 } 152 157 } … … 191 196 } 192 197 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 193 211 end 194 212 … … 200 218 name = @global_name 201 219 end 220 # p "region:#{get_name}" 202 221 f.print "\n#{indent}/*** #{get_namespace_path} region information cell ***/\n" 203 222 f.print <<EOT 204 223 #{indent}cell nTECSInfo::tRegionInfo #{name}RegionInfo{ 205 224 #{indent} name = "#{@name}"; 206 #{indent}}; 207 EOT 225 EOT 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 } 208 244 end 209 245 … … 221 257 self.print_info_region f, indent 222 258 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} 302 EOT 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 223 338 end 224 339 … … 227 342 f.print <<EOT 228 343 #{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_cellInLin Unit = 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}; 236 351 EOT 237 352 @port.each{ |port| … … 273 388 } 274 389 @attribute.each{ |decl| 275 decl.print_info f, @global_name, indent 390 decl.print_info f, @global_name, indent, :DECLTYPE_ATTR 276 391 } 277 392 @var.each{ |decl| 278 decl.print_info f, @global_name, indent 393 decl.print_info f, @global_name, indent, :DECLTYPE_VAR 279 394 } 280 395 end … … 295 410 if ! decl.is_omit? then 296 411 offset = "(uint32_t)(intptr_t)&(((#{@global_name}_#{inib_cb}*)0)->#{decl.get_name})" 412 place = inib_cb 297 413 else 298 414 offset = "0xffffffff" 415 place = "NON" 299 416 end 300 417 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 301 419 } 302 420 @var.each{ |decl| 303 if decl.get_size_is then421 if decl.get_size_is && has_INIB? then 304 422 inib_cb = "INIB" 305 423 else 306 424 inib_cb = "CB" 307 425 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 309 429 } 310 430 else … … 316 436 @attribute.each{ |decl| 317 437 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}" 318 439 } 319 440 @var.each{ |decl| 320 441 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}" 321 443 } 322 444 end … … 324 446 325 447 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 330 471 end 331 472 … … 365 506 end 366 507 end 367 if ( port.is_VMT_useless? && port.is_cell_unique? ) || @n_cell_gen == 0 then508 if ( port.is_VMT_useless? && port.is_cell_unique? ) || port.is_omit? || @n_cell_gen == 0 then 368 509 offset = "0xffffffff" 369 510 else … … 375 516 offset = "(uint32_t)(intptr_t)&((#{@global_name}_#{cb_inib}*)0)->#{port.get_name}" 376 517 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 377 525 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" 378 527 f.printf "#define %-50s (#{place})\n", "#{@global_name}_#{port.get_name}__place" 379 528 f.printf "#define %-50s (#{port.is_VMT_useless?})\n", "#{@global_name}_#{port.get_name}__b_VMT_useless" … … 382 531 } 383 532 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 384 547 end 385 548 … … 393 556 #{indent} cSignatureInfo = #{@signature.get_global_name}SignatureInfo.eSignatureInfo; 394 557 #{indent} b_inline = #{@b_inline}; 558 #{indent} array_size = C_EXP( "#{ct_global}_#{@name}__array_size" ); 395 559 #{indent}}; 396 560 EOT … … 401 565 #{indent} cSignatureInfo = #{@signature.get_global_name}SignatureInfo.eSignatureInfo; 402 566 #{indent} offset = C_EXP( "#{ct_global}_#{@name}__offset" ); 567 #{indent} array_size = C_EXP( "#{ct_global}_#{@name}__array_size" ); 403 568 #{indent} b_optional = #{@b_optional}; 404 569 #{indent} b_omit = #{@b_omit}; … … 418 583 end 419 584 585 class 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; 598 EOT 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; 604 EOT 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} }; 628 EOT 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 662 end 663 420 664 class Signature 421 665 def print_info f, indent … … 446 690 f.print <<EOT 447 691 #{indent}cell nTECSInfo::tFunctionInfo #{sig_name}_#{func_name}FunctionInfo { 448 #{indent} name = "#{ @owner.get_global_name}_#{@name}";692 #{indent} name = "#{get_name}"; 449 693 #{indent} bOneway = #{is_oneway?}; 450 694 EOT … … 502 746 503 747 class Decl 504 def print_info f, parent_ID_str, indent 748 def print_info f, parent_ID_str, indent, decl_type 505 749 if @size_is then 506 750 size = "\"mikan\""; … … 512 756 #{indent} name = "#{get_name}"; 513 757 #{indent} sizeIsExpr = #{size}; 514 #{indent} declType = DECLTYPE_STMEMBER;758 #{indent} declType = #{decl_type}; 515 759 #{indent} offset = C_EXP( "OFFSET_OF_#{parent_ID_str}_#{get_name}" ); 760 #{indent} place = C_EXP( "PLACE_OF_#{parent_ID_str}_#{get_name}" ); 516 761 #{indent} cTypeInfo = #{get_type.get_ID_str}TypeInfo.eTypeInfo; 517 762 #{indent}}; … … 523 768 class Type 524 769 @@typeinfo_printed = {} 770 771 def self.reset_print_info 772 @@typeinfo_printed = {} 773 end 774 525 775 def print_info f, indent 526 776 # Type の info は、最後にまとめて出力するので、ここでは記録するだけ … … 538 788 elsif self.kind_of? StructType then 539 789 get_members_decl.get_items.each{ |decl| 540 decl. get_type.print_info f, indent790 decl.print_info f, get_ID_str, indent, :DECLTYPE_STMEMBER 541 791 } 542 792 end … … 550 800 551 801 def print_info_post f, indent 552 bit_size = get_bit_size553 if bit_size == 0 then554 bit_size = "C_EXP( \"sizeof(#{get_type_str}#{get_type_str_post})\" )"555 end556 802 if self.class.superclass == Type then # 親クラスが Type の場合 types.rb のクラス 557 803 type_name = self.class.name … … 566 812 #{indent} name = "#{get_type_str}#{get_type_str_post}"; 567 813 #{indent} typeKind = TECSTypeKind_#{type_name}; 568 #{indent} bitSize = #{bit_size};814 #{indent} size = C_EXP( "sizeof(#{get_type_str}#{get_type_str_post})" ); 569 815 #{indent} b_const = #{is_const?}; 570 816 #{indent} b_volatile = #{is_volatile?}; 571 817 EOT 572 818 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" 574 820 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" 576 822 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" 578 824 elsif self.kind_of? StructType then 579 825 get_members_decl.get_items.each{ |decl| 580 f.print "#{indent} c TypeInfo[] = #{decl.get_type.get_ID_str}TypeInfo.eTypeInfo;\n"826 f.print "#{indent} cVarDeclInfo[] = #{get_ID_str}_#{decl.get_name}VarDeclInfo.eVarDeclInfo;\n" 581 827 } 582 828 elsif self.kind_of? DescriptorType then -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tool_info.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/types.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 5by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 629 629 630 630 class FloatType < Type 631 # @bit_size:: 32, 64, (80), -32, -64 631 # @bit_size:: 32, 64, (80), -32, -64, -128 632 632 633 633 def initialize( bit_size ) … … 684 684 when -64 685 685 str = "#{str}double" 686 when -128 687 str = "#{str}long double" 686 688 end 687 689 return str … … 1558 1560 # 動的結合で渡すデスクリプタ型 1559 1561 class DescriptorType < Type 1560 # @sinagure_nsp::NamespacePath 1562 # @sinagure_nsp::NamespacePath 1563 1564 @@descriptors = {} 1561 1565 1562 1566 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 1574 1570 end 1575 1571 … … 1595 1591 else 1596 1592 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 1597 1615 end 1598 1616 end -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_console_en_US.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_console_ja_JP.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_file_en_US.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2018 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 76 76 # * このファイルを編集して使用することが意図されていますが 77 77 # * tecsgen の再実行により上書きされてしまうため、通常 78 # * gen/%s_templ ate.c => src/%s.c78 # * gen/%s_templ.c => src/%s.c 79 79 # * のように名前, フォルダを変更してから修正します 80 80 # */ … … 83 83 * This file was automatically generated by tecsgen. 84 84 * Move and rename like below before editing, 85 * gen/%s_templ ate.c => src/%s.c85 * gen/%s_templ.c => src/%s.c 86 86 * to avoid to be overwritten by tecsgen. 87 87 */ … … 335 335 @@comment[ :TEFB_comment ] = "\t/* Put statements here %s */\n" 336 336 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" 337 342 end -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_file_ja_JP.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2018 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 65 65 * このファイルを編集して使用することが意図されていますが 66 66 * tecsgen の再実行により上書きされてしまうため、通常 67 * gen/%s_templ ate.c => src/%s.c67 * gen/%s_templ.c => src/%s.c 68 68 * のように名前, フォルダを変更してから修正します 69 69 */ … … 163 163 @@comment[ :TEPF_comment ] = "/* 受け口関数 %s */\n" 164 164 @@comment[ :TEFB_comment ] = "\t/* ここに処理本体を記述します %s */\n" 165 @@comment[ :MCPP_comment ] = "/* CB プロトタイプ宣言 %s */\n" 166 @@comment[ :MCPB_comment ] = "/* CB プロトタイプ宣言 %s */\n" 165 167 166 168 end -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1AlarmPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id 37 # $Id$ 38 38 #++ 39 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1DelayTaskPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id 37 # $Id$ 38 38 #++ 39 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1ISRPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id 37 # $Id$ 38 38 #++ 39 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1KernelPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id 37 # $Id$ 38 38 #++ 39 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1ResourcePlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id 37 # $Id$ 38 38 #++ 39 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1TaskPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id 37 # $Id$ 38 38 #++ 39 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/DomainPlugin.rb
r337 r374 46 46 #option::String : domain 指定子の第二引数 47 47 def initialize( region, domain_type_name, option ) 48 super() 48 49 end 49 50 … … 77 78 return false 78 79 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 79 91 end -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Cache.rb
r337 r374 1 1 # -*- coding: utf-8 -*- 2 2 3 # $Id$ 3 4 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2CyclicHandlerPlugin.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 2by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2DataqueuePlugin.rb
r337 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 2by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2EventflagPlugin.rb
r337 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 2by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2FixedSizeMemoryPoolPlugin.rb
r337 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 2by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2HandlerPlugin.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2018 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 77 77 elsif @plugin_arg_str == "ISR" 78 78 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]} }); 80 80 EOT 81 81 elsif @plugin_arg_str == "INIT_ROUTINE" 82 82 file.print <<EOT 83 #{tab}ATT_INI({ #{val[:attribute]}, &#{cell_CB_name}, tInitializeRoutine_start });83 #{tab}ATT_INI({ #{val[:attribute]}, #{cell_CBP}, tInitializeRoutine_start }); 84 84 EOT 85 85 elsif @plugin_arg_str == "TERM_ROUTINE" 86 86 file.print <<EOT 87 #{tab}ATT_TER({ #{val[:attribute]}, &#{cell_CB_name}, tTerminateRoutine_start });87 #{tab}ATT_TER({ #{val[:attribute]}, #{cell_CBP}, tTerminateRoutine_start }); 88 88 EOT 89 89 else -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2KernelObjectPlugin.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 2by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 186 186 val = {} 187 187 @celltype.get_attribute_list.each{ |a| 188 p a.get_name188 # p a.get_name 189 189 if a.get_type.kind_of?( ArrayType ) 190 190 val[a.get_name] = [] … … 218 218 if val[:id].nil? != true 219 219 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 ) ) 221 222 end 222 223 # $cbp$の代わり … … 244 245 file2.puts "}\n" 245 246 else 246 print "~~~~~ #{cell.get_region.get_name.to_s} is included in"247 p @@region_list247 dbgPrint "~~~~~ #{cell.get_region.get_name.to_s} is included in" 248 # p @@region_list 248 249 end 249 250 file3 = AppFile.open( "#{$gen}/tecsgen_#{cell_domain_root.get_name.to_s}.cfg" ) … … 260 261 if !val[:accessPattern].nil? 261 262 puts "===== begin check regions #{cell.get_name} =====" 262 p val[:accessPattern]263 p val[:accessPattern].class263 # p val[:accessPattern] 264 # p val[:accessPattern].class 264 265 265 266 #ep = [ :eTaskActivate, :eTaskControl, :eTaskManage, :eTaskRefer ] … … 273 274 if acptnx != "OMIT" 274 275 acv << acptnx 275 p acv[i]276 # p acv[i] 276 277 elsif cell_domain_type.get_option.to_s == "trusted" 277 278 acv << "TACP_KERNEL" 278 p acv[i]279 # p acv[i] 279 280 elsif cell_domain_type.get_option.to_s != "OutOfDomain" 280 281 acv << "TACP(#{cell_domain_root.get_name.to_s})" … … 286 287 } 287 288 288 print "acv = "289 dbgPrint "acv = " 289 290 p acv 290 291 … … 322 323 323 324 def self.check_referenced_cells() 324 puts "===== begin check registered celltype ====="325 dbgPrint "===== begin check registered celltype =====\n" 325 326 self.get_celltype_list.each { |ct| 326 p ct.get_name.to_s327 dbgPrint( ct.get_name.to_s + "\n" ) 327 328 } 328 puts "===== end check registered celltype ====="329 dbgPrint "===== end check registered celltype =====\n" 329 330 330 331 =begin … … 334 335 j = cell.get_join_list.get_item(p.get_name) 335 336 printf "===== check call port : " 336 p p.get_name.to_s337 # p p.get_name.to_s 337 338 next if j.nil? # 未結合の場合 338 339 if @@celltype_list.include?(j.get_celltype) … … 341 342 j.get_cell.set_referenced_cell(cell, j.get_port_name) 342 343 printf "===== check joined rhs cell : " 343 p j.get_cell.get_name.to_s344 # p j.get_cell.get_name.to_s 344 345 printf "===== check joined rhs port_name : " 345 p j.get_port_name346 # p j.get_port_name 346 347 end 347 348 } -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2ObjectPlugin.rb
r337 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Plugin.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 201 4by TOPPERS Project6 # Copyright (C) 2018 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 44 44 45 45 def initialize( region, name, option ) 46 super 46 47 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 47 59 end 48 60 … … 108 120 end 109 121 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 110 135 def joinable?(current_region, next_region, through_type ) 111 136 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 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 201 2by TOPPERS Project6 # Copyright (C) 2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2PriorityDataqueuePlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2RPCPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 … … 70 71 #=== RPCPlugin の initialize 71 72 # 説明は 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 ) 73 74 super 74 75 @b_noClientSemaphore = false … … 234 235 if cell.get_allocator_list.length > 0 then 235 236 236 dbgPrint "make allocator "237 dbgPrint "make allocator\n" 237 238 file.print "#{indent_str}[allocator(" 238 239 … … 269 270 nest = @end_region.gen_region_str_pre file 270 271 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 271 278 272 279 file.print <<EOT 273 280 #{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}; 275 282 //#{indent_str} #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name}; 276 283 #{indent_str} //cTDR = #{@channelCellName}.eTDR; -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SVCPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 … … 83 84 @@generated_celltype_header = {} 84 85 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 ) 86 87 super 87 88 @ct_name_body = "#{@ct_name}SVCBody_#{@next_cell.get_name}_#{@next_cell_port_name}".to_sym … … 217 218 nest = @end_region.gen_region_str_pre file 218 219 nest_str = " " * nest 220 if @next_cell_port_subscript then 221 subscript = '[' + @next_cell_port_subscript.to_s + ']' 222 else 223 subscript = "" 224 end 219 225 220 226 # サーバー側チャンネルの生成 … … 224 230 #{nest_str} // Server Side Channel 225 231 #{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}; 227 233 #{nest_str} }; 228 234 EOT … … 241 247 nest = @start_region.gen_region_str_pre file 242 248 nest_str = " " * nest 249 if @next_cell_port_subscript then 250 subscript = '[' + @next_cell_port_subscript.to_s + ']' 251 else 252 subscript = "" 253 end 243 254 244 255 # クライアント側チャンネルの生成 … … 247 258 #{nest_str} // Client Side Channel 248 259 #{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}; 250 261 #{nest_str} }; 251 262 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SemaphorePlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2TaskPlugin.rb
r359 r374 53 53 # tab : 54 54 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 ) ) 56 57 # $cbp$の代わり 57 58 index = cell.get_id - @celltype.get_id_base … … 59 60 cell_CB_name = "#{index}" 60 61 # CRE_XXX/DEF_XXXの生成 61 print "assign task plugin\n"62 dbgPrint "assign task plugin\n" 62 63 domainOption = cell.get_region.get_domain_root.get_domain_type.get_option 63 64 # if cell.get_region.get_region_type == :DOMAIN 65 # cell.show_tree 1 64 66 if domainOption != "OutOfDomain" 65 67 # 保護ドメインに属する場合 … … 69 71 raise "system task cannot have user stack." 70 72 end 73 p "CRE_TSK 0 user=#{val[:userStackSize]} system=#{val[:systemStackSize]}" 71 74 file.print <<EOT 72 75 #{tab}CRE_TSK(#{val[:id]}, { #{val[:taskAttribute]}, #{cell_CB_name}, tTask_start_task, #{val[:priority]}, #{val[:systemStackSize]}, NULL }); … … 77 80 raise "user task must have user stack." 78 81 end 82 p "CRE_TSK 1" 79 83 if val[:systemStackSize] == "OMIT" 80 84 file.print <<EOT … … 82 86 EOT 83 87 else 88 p "CRE_TSK 2" 84 89 file.print <<EOT 85 90 #{tab}CRE_TSK(#{val[:id]}, { #{val[:taskAttribute]}, #{cell_CB_name}, tTask_start_task, #{val[:priority]}, #{val[:userStackSize]}, NULL, #{val[:systemStackSize]}, NULL }); … … 138 143 regions = ct.get_domain_roots 139 144 regions_hrp2 = regions[ :HRP2 ] 140 print "HRP2 domain in #{ct.get_name}: "145 dbgPrint "HRP2 domain in #{ct.get_name}: " 141 146 regions_hrp2.each { |reg| 142 print reg.get_name147 dbgPrint reg.get_name 143 148 } 144 149 puts "" -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgePlugin.rb
r359 r374 3 3 # mruby => TECS bridge 4 4 # 5 # Copyright (C) 2008-201 5by TOPPERS Project5 # Copyright (C) 2008-2017 by TOPPERS Project 6 6 # 7 7 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MultiPlugin.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/NotifierPlugin.rb
r359 r374 1 1 # -*- coding: utf-8 -*- 2 # 3 # TECS Generator 4 # Generator for TOPPERS Embedded Component System 2 5 # 3 6 # Copyright (C) 2015 by Ushio Laboratory … … 5 8 # Copyright (C) 2015-2016 by Embedded and Real-Time Systems Laboratory 6 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 # Copyright (C) 2015-2018 by TOPPERS Project 7 11 # 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 #++ 8 44 9 45 NotifierPluginArgProc = { … … 128 164 # @param [Cell, Symbol] cell セル.セルについて一般化する場合は `:generic` 129 165 # @param [Integer, Symbol, nil] subscript 添字.添字について一般化する場合は `:generic` 166 # @param [Celltype] 呼び先のセルタイプ、cell==:generic の場合のみ有効 130 167 # @private 131 def generate_inner(context, fn_name, cell, subscript )168 def generate_inner(context, fn_name, cell, subscript, callee_ct=nil) 132 169 source_file = context.source_file 133 170 header_file = context.header_file … … 141 178 unless ct.is_singleton? 142 179 if cell == :generic 143 params << "(CELLIDX)extinf" 180 params << "(#{callee_ct.get_global_name}_IDX)extinf" 181 # params << "(CELLIDX)extinf" 144 182 else 145 183 # セルのCELLIDXを得る … … 233 271 234 272 generate_inner context, fn_name, 235 :generic, subscript 273 :generic, subscript, ct 236 274 237 275 props.each { |prop| … … 445 483 # join:: Join : 結合 (declarationがPortであるもの) 446 484 def validate_join(handler, cell, join) 447 485 return !generate_attr_map(handler, cell).nil? 448 486 end 449 487 … … 872 910 parse_plugin_arg 873 911 unless @factory 874 cdl_error(" ASP1003 celltype $1: option factory is not specified",912 cdl_error("NTF1003 celltype $1: option factory is not specified", 875 913 celltype.get_name) 876 914 end 877 915 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", 879 917 celltype.get_name) 880 918 end … … 883 921 def set_factory(template_string) 884 922 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", 886 924 celltype.get_name) 887 925 end … … 891 929 def set_factory_output_file(output_file) 892 930 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", 894 932 celltype.get_name) 895 933 end … … 898 936 899 937 def gen_factory file 900 puts "===== begin #{@celltype.get_name.to_s} plugin ====="938 # puts "===== begin #{@celltype.get_name.to_s} plugin =====" 901 939 902 940 kernelCfg = AppFile.open( "#{$gen}/#{@output_file}" ) … … 922 960 subst_attr = @celltype.find(name) 923 961 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.", 925 963 @celltype.get_name, name) 926 964 end … … 935 973 936 974 kernelCfg.close 937 puts "===== end #{@celltype.get_name.to_s} plugin ====="975 # puts "===== end #{@celltype.get_name.to_s} plugin =====" 938 976 end 939 977 940 978 def gen_factory_for_cell(kernelCfg, cell) 979 # print "########## gen_factory_for_cell cell=#{cell.get_name}\n" 941 980 handler_flags = [] 942 981 handler_args = [] … … 959 998 when 'false' then ignoreErrors = false 960 999 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", 962 1001 cell.get_name, ignoreErrors ) 963 1002 ignoreErrors = false 964 1003 end 965 1004 1005 # ドメイン指定用文字列 1006 pre_text = "" 1007 post_text = "\n" 1008 indent = "" 1009 966 1010 [EVENT_HANDLER, ERROR_HANDLER].each { |handler| 967 1011 # 呼び口の結合を取得 968 1012 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 969 1024 970 1025 # ハンドラタイプを判別する … … 974 1029 975 1030 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 ) 977 1032 next 978 1033 end 979 1034 980 1035 # 最初に見つかった有効なハンドラタイプを使用 981 1036 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 982 1086 983 1087 # 通知ハンドラで「エラーが発生するはずがない」のに「エラーハンドラが指定されている」 … … 986 1090 # なため、検出は行わない。) 987 1091 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.", 989 1093 cell.get_name, handler_flag) 990 1094 end 991 1095 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.", 993 1097 cell.get_name, handler_flag) 994 1098 end … … 1057 1161 # $id$等の置換 1058 1162 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 1066 1192 1067 1193 end -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/OpaqueRPCPlugin.rb
r337 r374 56 56 #=== RPCPlugin の initialize 57 57 # 説明は 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 ) 59 59 super 60 60 @b_noClientSemaphore = false … … 254 254 nest = @end_region.gen_region_str_pre file 255 255 nest_str = " " * nest 256 if @next_cell_port_subscript then 257 subscript = '[' + @next_cell_port_subscript.to_s + ']' 258 else 259 subscript = "" 260 end 256 261 257 262 if @serverErrorHandler then … … 282 287 #{nest_str} cell #{@rpc_server_channel_celltype_name} #{@serverChannelCell}_Unmarshaler { 283 288 #{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}; 285 290 #{serverErrorHandler_str}#{nest_str} }; 286 291 EOT -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/RPCPlugin.rb
r337 r374 65 65 #=== RPCPlugin の initialize 66 66 # 説明は 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 ) 68 68 super 69 69 @b_noClientSemaphore = false … … 197 197 nest = @region.gen_region_str_pre file 198 198 indent_str = " " * nest 199 if @next_cell_port_subscript then 200 subscript = '[' + @next_cell_port_subscript.to_s + ']' 201 else 202 subscript = "" 203 end 199 204 200 205 file.print <<EOT … … 233 238 file.print <<EOT 234 239 #{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}; 236 241 #{indent_str} cTDR = #{@channelCellName}.eTDR; 237 242 #{indent_str} cEventflag = #{@channelCellName}.eEventflag; -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedOpaqueRPCPlugin.rb
r337 r374 68 68 #=== RPCPlugin の initialize 69 69 # 説明は 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 ) 71 71 super 72 72 initialize_opaque_marshaler … … 221 221 nest = @start_region.gen_region_str_pre file 222 222 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 223 229 224 230 # セルを探す … … 303 309 #{indent_str}cell #{@unmarshaler_celltype_name} #{@cell_name}_Server { 304 310 #{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}; 306 312 #{ppallocator_join}#{indent_str}}; 307 313 EOT -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedRPCPlugin.rb
r337 r374 62 62 #=== RPCPlugin の initialize 63 63 # 説明は 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 ) 65 65 66 66 # mikan プラグインオプション指定の不一致のチェック task_priority, … … 236 236 nest = @region.gen_region_str_pre file 237 237 indent_str = " " * nest 238 if @next_cell_port_subscript then 239 subscript = '[' + @next_cell_port_subscript.to_s + ']' 240 else 241 subscript = "" 242 end 238 243 239 244 # セルを探す … … 291 296 file.print <<EOT 292 297 #{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}; 294 299 #{indent_str} cTDR = #{@shared_channel_cell}.eTDR; 295 300 #{indent_str} cEventflag = #{@shared_channel_cell}.eEventflag; -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ThroughPlugin.rb
r337 r374 47 47 #@next_cell:: Cell 呼び口を結合するセル 48 48 #@next_cell_port_name:: Symbol 呼び口を結合する受口の名前 49 #@next_cell_port_subscript::Nil|Integer 呼び口を結合する受口の配列添数.受け口配列でない場合 nil 49 50 #@signature:: Signature シグニチャ 50 51 #@celltype:: Celltype 呼び先のセルのセルタイプ. through が連接する場合、最終的な呼び先のセルのセルタイプ … … 74 75 #next_cell:: Cell 呼び口を接続するセル 75 76 #next_cell_port_name:: Symbol 呼び口を接続する受口の名前 77 #next_cell_port_subscript:: Nil|Integer 呼び口を接続する受口配列添数 76 78 #signature:: Signature シグニチャ 77 79 #celltype:: Celltype セルタイプ (呼び先のセルのセルタイプ) 78 80 #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 ) 80 82 super() 81 83 @cell_name = cell_name # 生成すべきセル名(受け口側のセル名) … … 83 85 @next_cell = next_cell # 呼び先のセル 84 86 @next_cell_port_name = next_cell_port_name 87 @next_cell_port_subscript = next_cell_port_subscript 85 88 @signature = signature 86 89 @entry_port_name = :"eThroughEntry" … … 136 139 def get_through_entry_port_name 137 140 @entry_port_name 141 end 142 143 #=== 生成されたセルの受け口配列添数を得る 144 def get_through_entry_port_subscript 145 @entry_port_subscript 138 146 end 139 147 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/TracePlugin.rb
r337 r374 44 44 #=== TracePlugin の initialize 45 45 # 説明は 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 ) 47 47 48 48 @maxArrayDisplay = 16 … … 141 141 nest = @region.gen_region_str_pre file 142 142 indent_str = " " * nest 143 if @next_cell_port_subscript then 144 subscript = '[' + @next_cell_port_subscript.to_s + ']' 145 else 146 subscript = "" 147 end 143 148 144 149 if @probeName then … … 155 160 file.print <<EOT 156 161 #{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}; 158 163 #{probeName_str}#{caller_cell_str}#{indent_str}}; 159 164 EOT … … 210 215 } 211 216 file.print( " );\n" ) 217 if @next_cell_port_subscript then 218 subscript = '[' + @next_cell_port_subscript.to_s + ']' 219 else 220 subscript = "" 221 end 212 222 213 223 file.print <<EOT 214 224 \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 ); 216 226 EOT 217 227 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenHRP2Marshaler.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenOpaqueMarshaler.rb
r337 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2018 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 464 464 /* Channel Lock */ 465 465 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 } 468 470 EOT 469 471 … … 554 556 /* Channel Unlock */ 555 557 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 } 562 EOT 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_; 558 568 EOT 559 569 … … 630 640 file.print <<EOT 631 641 }else{ 632 return ;642 return E_ID; 633 643 } 634 644 EOT -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenTransparentMarshaler.rb
r337 r374 388 388 }; 389 389 #{ppallocator_dealloc_str} 390 return ;390 return E_OK; 391 391 392 392 error_reset: … … 394 394 (void)cTDR_reset(); 395 395 #{ppallocator_dealloc_str} 396 return E_OK; 396 397 EOT 397 398 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/version.rb
r337 r374 1 1 $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 42 42 INCLUDES := $(INCLUDES) -I$(TINET_ROOT)/netdev/$(NET_DEV) 43 43 TINET_DIRS := $(TINET_DIRS):$(TINET_ROOT)/netdev/$(NET_DEV) 44 TINET_COBJS := $(TINET_COBJS) nap_main.o panu_main.o if_btusb.o44 TINET_COBJS := $(TINET_COBJS) bt_main.o if_btusb.o 45 45 TINET_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 58 58 #include "sdp.h" 59 59 #include "pan.h" 60 #include "panu_main.h" 60 #include "bt_main.h" 61 #include "usb_hbth.h" 61 62 62 63 //#define PACKET_DUMP … … 66 67 67 68 #define RFCOMM_SERVER_CHANNEL 1 68 /*static*/uint16_t rfcomm_channel_id = FAILED_RFCOMM_ID_NOT_SET;69 static uint16_t rfcomm_channel_id = FAILED_RFCOMM_ID_NOT_SET; 69 70 70 71 static int record_id = -1; … … 90 91 91 92 volatile int bt_bnep_mode = 0; 92 bool_t bt_enabled = false; 93 94 enum 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 104 enum bt_state_t bt_state = BT_STATE_DORMANT; 105 int bt_timer; 93 106 94 107 // outgoing network packet … … 108 121 break; 109 122 case DE_SIZE_VAR_16: 110 len = READ_NET_16(element, 1);123 len = big_endian_read_16(element, 1); 111 124 break; 112 125 default: … … 129 142 130 143 // 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 == B NEP_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)) { 132 145 bnep_l2cap_psm = sdp_bnep_l2cap_psm; 133 146 bnep_remote_uuid = sdp_bnep_remote_uuid; … … 146 159 147 160 switch (event->type) { 148 case SDP_ QUERY_ATTRIBUTE_VALUE:161 case SDP_EVENT_QUERY_ATTRIBUTE_VALUE: 149 162 value_event = (sdp_query_attribute_value_event_t*)event; 150 163 … … 165 178 166 179 switch (value_event->attribute_id) { 167 case SDP_ServiceClassIDList:180 case BLUETOOTH_ATTRIBUTE_SERVICE_CLASS_ID_LIST: 168 181 if (de_get_element_type(attribute_value) != DE_DES) break; 169 182 for (des_iterator_init(&des_list_it, attribute_value); des_iterator_has_more(&des_list_it); des_iterator_next(&des_list_it)) { … … 172 185 uint32_t uuid = de_get_uuid32(element); 173 186 switch (uuid) { 174 case B NEP_UUID_PANU:175 case B NEP_UUID_NAP:176 case B NEP_UUID_GN:187 case BLUETOOTH_SERVICE_CLASS_PANU: 188 case BLUETOOTH_SERVICE_CLASS_NAP: 189 case BLUETOOTH_SERVICE_CLASS_GN: 177 190 log_info("SDP Attribute 0x%04x: BNEP PAN protocol UUID: %04x", value_event->attribute_id, uuid); 178 191 sdp_bnep_remote_uuid = uuid; … … 192 205 free(str); 193 206 break; 194 case SDP_ProtocolDescriptorList: {207 case BLUETOOTH_ATTRIBUTE_PROTOCOL_DESCRIPTOR_LIST: { 195 208 log_info("SDP Attribute: 0x%04x", value_event->attribute_id); 196 209 … … 210 223 uuid = de_get_uuid32(element); 211 224 switch (uuid) { 212 case SDP_L2CAPProtocol:225 case BLUETOOTH_PROTOCOL_L2CAP: 213 226 if (!des_iterator_has_more(&prot_it)) continue; 214 227 des_iterator_next(&prot_it); 215 228 de_element_get_uint16(des_iterator_get_element(&prot_it), &sdp_bnep_l2cap_psm); 216 229 break; 217 case SDP_BNEPProtocol:230 case BLUETOOTH_PROTOCOL_BNEP: 218 231 if (!des_iterator_has_more(&prot_it)) continue; 219 232 des_iterator_next(&prot_it); … … 238 251 break; 239 252 240 case SDP_ QUERY_COMPLETE:253 case SDP_EVENT_QUERY_COMPLETE: 241 254 handle_sdp_client_record_complete(); 242 255 complete_event = (sdp_query_complete_event_t*)event; … … 246 259 } 247 260 else { 261 bnep_do_connect = false; 248 262 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; 249 268 } 250 269 break; … … 269 288 if (packet[2] == HCI_STATE_WORKING) { 270 289 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 } 274 299 } 275 300 break; … … 284 309 285 310 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); 288 313 log_info("BD-ADDR: %s", bd_addr_to_str(event_addr)); 289 314 … … 292 317 break; 293 318 } 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); 296 321 break; 297 322 } … … 301 326 // deny link key request 302 327 log_info("Link key request"); 303 bt_flip_addr(event_addr, &packet[2]);328 reverse_bd_addr(&packet[2], event_addr); 304 329 hci_send_cmd(&hci_link_key_request_negative_reply, &event_addr); 305 330 break; … … 308 333 // inform about pin code request 309 334 log_info("Pin code request - using '0000'"); 310 bt_flip_addr(event_addr, &packet[2]);335 reverse_bd_addr(&packet[2], event_addr); 311 336 hci_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000"); 312 337 break; … … 314 339 case HCI_EVENT_USER_CONFIRMATION_REQUEST: 315 340 // 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)); 317 342 log_info("HCI User Confirmation Auto accept"); 318 343 break; … … 320 345 case RFCOMM_EVENT_INCOMING_CONNECTION: 321 346 // 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); 323 348 rfcomm_channel_nr = packet[8]; 324 rfcomm_channel_id = READ_BT_16(packet, 9);349 rfcomm_channel_id = little_endian_read_16(packet, 9); 325 350 log_info("RFCOMM channel %u requested for %s", rfcomm_channel_nr, bd_addr_to_str(event_addr)); 326 351 rfcomm_accept_connection_internal(rfcomm_channel_id); … … 333 358 } 334 359 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); 337 362 log_info("RFCOMM channel open succeeded. New RFCOMM Channel ID %u, max frame size %u", rfcomm_channel_id, mtu); 338 363 } … … 347 372 if (packet[2]) { 348 373 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; 349 378 } 350 379 else { 351 380 // 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); 357 386 memcpy(&remote_addr, &packet[11], sizeof(bd_addr_t)); 358 387 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); … … 360 389 btstack_network_up(bnep_cid, (uint8_t *)hci_local_bd_addr(), (uint8_t *)remote_addr); 361 390 log_info("Network Interface %s activated", btstack_network_get_name(bnep_cid)); 391 392 bt_state = BT_STATE_CONNECTED; 393 bt_timer = -1; 362 394 } 363 395 break; … … 368 400 369 401 case BNEP_EVENT_CHANNEL_CLOSED: 370 bnep_cid = READ_BT_16(packet, 2);402 bnep_cid = little_endian_read_16(packet, 2); 371 403 bt_channel_closed(bnep_cid); 404 405 // 30秒後 BNEP Query 開始 406 bt_state = BT_STATE_BNEP_QUERY_WAIT; 407 bt_timer = 30 * 1000; 372 408 break; 373 409 374 410 case BNEP_EVENT_READY_TO_SEND: 375 bnep_cid = READ_BT_16(packet, 2);411 bnep_cid = little_endian_read_16(packet, 2); 376 412 bt_send_packet(bnep_cid); 377 413 break; … … 428 464 } 429 465 430 void panu_init(void)466 void bt_init(void) 431 467 { 432 468 const hci_transport_t *transport; … … 437 473 service_record_item_t *bnep_service_record_item; 438 474 475 btstack_network_init(&network_send_packet_callback); 476 439 477 //hci_dump_open("", HCI_DUMP_PACKETLOGGER); 440 441 log_info("bt初期化...");442 478 443 479 // start with BTstack init - especially configure HCI Transport … … 446 482 447 483 /* Initialize HCI */ 448 log_info("HCI初期化...");449 484 transport = hci_transport_usb_instance(); 450 485 control = NULL; … … 455 490 456 491 /* Initialize L2CAP */ 457 log_info("L2CAP初期化...");458 492 l2cap_init(); 459 493 l2cap_register_packet_handler(packet_handler); 460 494 461 495 /* Initialise SDP, create record for SPP and register with SDP */ 462 log_info("SDP初期化...");463 496 sdp_init(); 464 497 465 498 /* Initialize RFCOMM */ 466 log_info("RFCOMM初期化...");467 499 rfcomm_init(); 468 500 rfcomm_register_packet_handler(packet_handler); … … 470 502 471 503 /* Initialise BNEP */ 472 log_info("BNEP初期化...");473 504 bnep_init(); 474 505 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 } 476 512 477 513 memset(spp_service_buffer, 0, sizeof(spp_service_buffer)); … … 482 518 bnep_service_record_item = (service_record_item_t *)bnep_service_buffer; 483 519 484 log_info("SPPサービス登録...");485 520 sdp_create_spp_service((uint8_t*)&spp_service_record_item->service_record, 1, "RX SPP"); 486 521 de_dump_data_element((uint8_t*)spp_service_record_item->service_record); … … 488 523 sdp_register_service_internal(NULL, spp_service_record_item); 489 524 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 } 494 536 sdp_register_service_internal(NULL, bnep_service_record_item); 495 537 … … 500 542 501 543 /* Turn on the device */ 502 log_info("HCI電源ON...");503 544 hci_power_control(HCI_POWER_ON); 504 545 … … 506 547 sdp_parser_init(); 507 548 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 554 void bt_process(void) 555 { 556 if (bt_state != BT_STATE_DORMANT) { 532 557 run_loop_execute(); 533 558 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; 534 576 } 535 577 } … … 592 634 hci_close(); 593 635 594 bt_enabled = false; 595 } 636 bt_state = BT_STATE_DORMANT; 637 bt_timer = -1; 638 } 639 640 void bt_task_on_start(struct task_if_t *task, ID tskid) 641 { 642 } 643 644 void bt_task_on_end(struct task_if_t *task) 645 { 646 } 647 648 int bt_task_get_timer(struct task_if_t *task) 649 { 650 return bt_timer; 651 } 652 653 void 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 663 void 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 683 struct 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 1 1 /* 2 * panu_main.h2 * bt_main.h 3 3 * 4 4 */ … … 16 16 17 17 void bt_init(void); 18 void bt_task(void);19 18 int bt_can_send_packet(void); 20 19 void bt_send_packet(uint16_t bnep_cid); -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/netdev/if_btusb/if_btusb.c
r364 r374 79 79 #include "kernel/kernel_impl.h" 80 80 #include "btstack/utils.h" 81 #include " panu_main.h"81 #include "bt_main.h" 82 82 #include "usb_hbth.h" 83 83 //#include "hal_cpu.h"
Note:
See TracChangeset
for help on using the changeset viewer.