changeset 639:2f12d8263f88

remove token*
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Tue, 30 Jun 2020 13:50:42 +0900
parents 4d694297b674
children 410f88ef3d47
files src/parallel_execution/examples/piposaru/LexerImpl.cbc src/parallel_execution/examples/piposaru/token.h src/parallel_execution/examples/piposaru/token_impl.cbc src/parallel_execution/examples/piposaru/token_impl.h
diffstat 4 files changed, 3 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/examples/piposaru/LexerImpl.cbc	Sun Jun 28 18:37:37 2020 +0900
+++ b/src/parallel_execution/examples/piposaru/LexerImpl.cbc	Tue Jun 30 13:50:42 2020 +0900
@@ -20,7 +20,7 @@
 }
 __code read_char_LexerImpl(struct LexerImpl* lexer, char* ch, __code next(... )) {
     printf("%s\n", ch);
-    goto hello2(next);
+    goto hello2(ch, next);
 }
 
 __code eat_whitespace_LexerImpl(struct LexerImpl* lexer, char* ch, __code next(... )) {
@@ -38,7 +38,7 @@
     goto next(...);
 }
 
-__code hello2(struct LexerImpl* lexer, __code next(...)) {
-  printf("Hello2! Test!\n");
+__code hello2(struct LexerImpl* lexer, char* ch, __code next(...)) {
+  printf("Hello2! Test! This is c ! %s\n", ch);
   goto next(...);
 }
--- a/src/parallel_execution/examples/piposaru/token.h	Sun Jun 28 18:37:37 2020 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#include "piposaru.h"
-
-typedef struct token <Type, Impl> {
-  __code add(Impl* token, enum TokenKind tk, char* datum, __code next(...));
-  __code next(....);
-} token;
--- a/src/parallel_execution/examples/piposaru/token_impl.cbc	Sun Jun 28 18:37:37 2020 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-#include "../../../context.h"
-#interface "token.h"
-
-// ----
-// typedef struct token_impl <Type, Isa> impl token {
-//     __code next(....);
-// } token_impl;
-// ----
-
-token* createtoken_impl(struct Context* context) {
-    struct token* token  = new token();
-    struct token_impl* token_impl = new token_impl();
-    token->token = (union Data*)token_impl;
-    token->add = C_add_token_impl;
-    return token;
-}
-__code add_token_impl(struct token_impl* token, enum TokenKind tk, char* datum, __code next(...)) {
-
-    goto next(...);
-}
-
--- a/src/parallel_execution/examples/piposaru/token_impl.h	Sun Jun 28 18:37:37 2020 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-typedef struct token_impl <Type, Isa> impl token {
-    __code next(....);
-} token_impl;