Hello Worldはサイトに載っているので自分で何とか書いてみた。
英文を通すのに一苦労w
test.spl
|
The test program of Shakespeare.
Romeo, a young man with a remarkable patience. Juliet, a likewise young woman of remarkable grace.
Act I: Romeo and Juliet. Scene I: Romeo asks to Juliet her mind.
[Enter Romeo and Juliet]
Romeo: Open your mind! Speak your mind!
Juliet: You are as good as the sum of a big tree and a beautiful flower. Open your heart!
[Exeunt] |
cygwin上で作成したspl2cを使って以下のようにsplをCへ
spl2c < test.spl > test.c
出力されたCのソースがこちら
test.c
|
/******************************************************************** * This C program was generated by spl2c, the Shakespeare to C * * converter by Jon ナslund and Karl Hasselstr. * ********************************************************************/
/* libspl definitions and function prototypes */ #include
int main(void) { /****************************************************************** * THE TEST PROGRAM OF SHAKESPEARE * ******************************************************************/
CHARACTER *romeo; /* a young man with a remarkable patience */ CHARACTER *juliet; /* a likewise young woman of remarkable grace */
int comp1, comp2;
global_initialize();
romeo = initialize_character("Romeo"); juliet = initialize_character("Juliet");
act_i: /* Romeo and Juliet */
act_i_scene_i: /* Romeo asks to Juliet her mind */
enter_scene(9, romeo); enter_scene(9, juliet);
activate_character(15, romeo); char_input(12, second_person); char_output(13, second_person);
activate_character(19, juliet); assign(16, second_person, int_add(16, 2*1, 2*1)); int_output(17, second_person);
exit_scene_all(19);
return 0; } |
慢性的な人材不足と開発効率の上がらない組み込み業界のブレイクスルーとなるか!と期待をしていたのですが、この出力結果を見ると、どうやら組み込み用途で使用するのは困難なようです。