aboutsummaryrefslogtreecommitdiff
path: root/libstorycode
diff options
context:
space:
mode:
Diffstat (limited to 'libstorycode')
-rw-r--r--libstorycode/slide.h1
-rw-r--r--libstorycode/storycode.y28
2 files changed, 24 insertions, 5 deletions
diff --git a/libstorycode/slide.h b/libstorycode/slide.h
index be9b08c..0e1f005 100644
--- a/libstorycode/slide.h
+++ b/libstorycode/slide.h
@@ -28,6 +28,7 @@
#endif
typedef struct _slide Slide;
+typedef struct _slideitem SlideItem;
extern Slide *slide_new(void);
extern void slide_free(Slide *n);
diff --git a/libstorycode/storycode.y b/libstorycode/storycode.y
index 33336a7..095ed96 100644
--- a/libstorycode/storycode.y
+++ b/libstorycode/storycode.y
@@ -27,9 +27,18 @@
void scerror(const char *s);
%}
-%define api.value.type {char *}
%define api.token.prefix {SC_}
%define api.prefix {sc}
+
+%union {
+ Presentation *p;
+ Stylesheet *ss;
+ Narrative *n;
+ Slide *s;
+ SlideItem *si;
+ char *str;
+}
+
%token STYLES SLIDE
%token NARRATIVE
%token PRESTITLE
@@ -49,6 +58,15 @@
%token PLUS TIMES
%token UNIT VALUE
+%type <p> presentation
+%type <n> narrative
+%type <s> slide
+%type <ss> stylesheet
+%type <str> prestitle
+%type <str> STRING
+%type <str> bulletpoint
+%type <si> textframe
+
%%
presentation:
@@ -62,10 +80,10 @@ narrative:
;
narrative_el:
- prestitle { printf("prestitle: '%s'\n", $1); }
-| bulletpoint { printf("* '%s'\n", $1); }
-| slide
-| STRING { printf("Text line '%s'\n", $1); }
+ prestitle { narrative_add_prestitle(n, $1); }
+| bulletpoint { narrative_add_bp(n, $1); }
+| slide { narrative_add_slide(n, $1); }
+| STRING { narrative_add_text(n, $1); }
;
/* Can be in narrative or slide */