From 5afef8192307c46bec4c8c63e5c625b457146a15 Mon Sep 17 00:00:00 2001 From: jimtahu Date: Thu, 9 May 2013 21:50:21 -0400 Subject: [PATCH] Started work on vectors --- LangS.ypp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/LangS.ypp b/LangS.ypp index fe2db59..3827213 100644 --- a/LangS.ypp +++ b/LangS.ypp @@ -34,12 +34,13 @@ Prog: Stm ';' Prog { theProg->add((Statement *)$1); } Stm: Exit { $$ = new ExitStatement();} | Scalar '=' Value { $$ = new AssingmentStatement((Identifier*)$1,(Value*)$3); } - | Vector '=' List { } + | Vector '=' List { $$ = new AssingmentStatement((Identifier*)$1,new StringValue("#list#")); } | Value { } | Print Value { $$ = new PrintStatement((Value*)$2); } -Value: Scalar { $$ = $1; } - | STRING { $$ = $1; } +Value: STRING { $$ = $1; } + | Vector { $$ = $1; } + | Scalar { $$ = $1; } | Value BinOP Value { $$ = new BinOpValue(((Identifier*)$2)->getName(),(Value*)$1,(Value*)$3); } List: '[' Items ']'