View my_numeric.y
# coding: utf-8
#
# <数値> ::= <数字列> | <符号><数字列> | <数字列>.<数字列> | <符号><数字列>.<数字列>
# <数字列> ::= <数字> | <数字列> <数字>
# <数字> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
# <符号> ::= + | - | ± # ±は省略
class MyNumeric
rule
target : numeric_num { result = 'ok' }
View racoon.y
# coding: utf-8
class RacoonParser
rule
start code
code : code s_exp
| s_exp
s_exp : '(' func params ')' { result = @racoon.send(val[1], val[2]) }
param : s_exp
| atom
params : params param { result = val[0..1] }
View h30h_ap_pm3_2.c
#include <stdio.h>
#define M 4
#define N 3
int m, n, printFlag;
int board[M+4+1][N+4+1] = { 0 };
int dv[] = { 0, -2, -1, 1, 2, 2, 1, -1, -2};
int dh[] = { 0, 1, 2, 2, 1, -1, -2, -2, -1};
View h30h_ap_pm3_1.c
#include <stdio.h>
#define M 4
#define N 3
int m, n, printFlag;
int board[M+1][N+1] = { 0 };
int dv[] = { 0, -2, -1, 1, 2, 2, 1, -1, -2};
int dh[] = { 0, 1, 2, 2, 1, -1, -2, -2, -1};
View h30h_fe_pm12_3.casl
PROG3 START
CALL MULT
RET
END
MULT START
RPUSH
LAD GR1,DATA ; 追加しました
LAD GR2,CTBL
CALL GETWD
LD GR4,0,GR2 ; GR4 <- 被乗数
View h30h_fe_pm12_2.casl
PRO2 START
LAD GR1,DATA
LAD GR2,CTBL
CALL GETWD
RET
DATA DC ' 1234 56789 9876 .'
CTBL DS 4
END
GETWD START
RPUSH
View h30h_fe_pm12_1.casl
PRO1 START
LAD GR1,DATA
LD GR2,=3
CALL DTOB
RET
DATA DC #0035,#0036,#0037
END
DTOB START
RPUSH
ADDL GR2,GR1
View h30h_fe_pm9_2.c
#include <stdio.h>
#include <stdlib.h>
#define listLen 32 /* 入力レコードの最大文字数 + 2('\n', '\0') */
void outListG(char *listFile) {
FILE *inFile;
char inBuf[listLen];
long value, valueMax;
char graph[] = "*************************";
View h30h_fe_pm9_1.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define recSize 1002 /* 入力レコードの最大文字数 + 2('\n', '\0') */
void outList(char *dataFile, char *listFile,
int keyPos, int keyLen, int valuePos, int valueLen) {
FILE *inFile, *outFile;
char inBuf[recSize], inKey[10], key[10], temp[10];
View h30h_fe_pm8.c
#include <stdio.h>
int lchild(int i);
int rchild(int i);
int parent(int i);
void swap(int heap[], int i, int j);
void makeHeap(int data[], int heap[], int hnum);
void heapSort(int data[], int heap[], int hnum);
void downHeap(int heap[], int hlast);
void print_array(int arr[], int num); /* 配列表示用 */