[Redbutton-devel] SF.net SVN: redbutton: [421] redbutton-author/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2007-09-24 16:15:51
|
Revision: 421
http://redbutton.svn.sourceforge.net/redbutton/?rev=421&view=rev
Author: skilvington
Date: 2007-09-24 09:15:46 -0700 (Mon, 24 Sep 2007)
Log Message:
-----------
fix ConnectionTag Null issue
Modified Paths:
--------------
redbutton-author/trunk/TODO
redbutton-author/trunk/ccc.l
redbutton-author/trunk/ccc.y
redbutton-author/trunk/grammar
Modified: redbutton-author/trunk/TODO
===================================================================
--- redbutton-author/trunk/TODO 2007-09-24 16:03:05 UTC (rev 420)
+++ redbutton-author/trunk/TODO 2007-09-24 16:15:46 UTC (rev 421)
@@ -1,14 +1,5 @@
-NewContentSize param in NewReferencedContent should compile to:
-[CONTEXT 234] { ... [UNIVERSAL 5] ... }
-not just [CONTEXT 234] { ... nothing ... }
-- ie need to add an explicit Null child node
+NewReferencedContent Null is in the wrong place
-same with ConnectionTag param in TransitionTo
-
-temp fix - add "Null" to the relevent 2 places in the grammar?
-real fix - add "Identifier?" to the grammar => optional, but adds a Null if not
- present (or perhaps "<Identifier>")
-
---
output filename should default to App/Scene GroupIdentifier rather than "a"
Modified: redbutton-author/trunk/ccc.l
===================================================================
--- redbutton-author/trunk/ccc.l 2007-09-24 16:03:05 UTC (rev 420)
+++ redbutton-author/trunk/ccc.l 2007-09-24 16:15:46 UTC (rev 421)
@@ -13,6 +13,7 @@
"[" return LBRACKET;
"]" return RBRACKET;
"+" return ONEORMORE;
+"?" return IDENTORNULL;
"." return ENDCLAUSE;
[\n\r\f] yylineno ++;
[ \t]+ /* ignore whitespace */
Modified: redbutton-author/trunk/ccc.y
===================================================================
--- redbutton-author/trunk/ccc.y 2007-09-24 16:03:05 UTC (rev 420)
+++ redbutton-author/trunk/ccc.y 2007-09-24 16:15:46 UTC (rev 421)
@@ -19,7 +19,8 @@
IT_LITERAL, /* "LiteralString" */
IT_IDENTIFIER, /* NormalIdentifier */
IT_OPTIONAL, /* [OptionalIdentifier] */
- IT_ONEORMORE /* OneOrMoreIdentifier+ */
+ IT_ONEORMORE, /* OneOrMoreIdentifier+ */
+ IT_IDENTORNULL /* IdentifierOrNull? */
};
struct item
@@ -109,6 +110,7 @@
%token LBRACKET
%token RBRACKET
%token ONEORMORE
+%token IDENTORNULL
%token ENDCLAUSE
%token INVALID
@@ -172,6 +174,11 @@
{
add_item(IT_ONEORMORE, $1);
}
+ |
+ IDENTIFIER IDENTORNULL
+ {
+ add_item(IT_IDENTORNULL, $1);
+ }
;
%%
@@ -565,8 +572,8 @@
for(item=state.items; item; item=item->next)
{
/* assert */
- if(item->type != IT_IDENTIFIER && item->type != IT_LITERAL && item->type != IT_OPTIONAL)
- fatal("SEQUENCE but not Identifier, Literal or Optional");
+ if(item->type == IT_ONEORMORE)
+ fatal("SEQUENCE contains OneOrMore+");
/* eat literals, parse [optional] identifiers */
buf_append(&state.parse_fns, "\n\t/* %s */\n", item->name);
if(item->type == IT_LITERAL)
@@ -580,11 +587,19 @@
buf_append(&state.parse_fns, "\tnext = peek_token();\n");
buf_append(&state.parse_fns, "\tif(is_%s(next))\n", item->name);
buf_append(&state.parse_fns, "\t\tparse_%s(parent);\n", item->name);
- if(item->type != IT_OPTIONAL)
+ /* not optional => generate an error if it is not present */
+ if(item->type == IT_IDENTIFIER)
{
buf_append(&state.parse_fns, "\telse\n");
buf_append(&state.parse_fns, "\t\tparse_error(\"Expecting %s\");\n", item->name);
}
+ /* not optional - if it is not present, add a Null instead */
+ else if(item->type == IT_IDENTORNULL)
+ {
+ buf_append(&state.parse_fns, "\telse\n");
+ buf_append(&state.parse_fns, "\t\t(void) add_child(parent, ASN1TAGCLASS_NULL);\n");
+ }
+ /* else { optional - don't care if it is not present } */
}
}
break;
Modified: redbutton-author/trunk/grammar
===================================================================
--- redbutton-author/trunk/grammar 2007-09-24 16:03:05 UTC (rev 420)
+++ redbutton-author/trunk/grammar 2007-09-24 16:15:46 UTC (rev 421)
@@ -729,7 +729,7 @@
ComparisonValue ")" .
Toggle ::= ":Toggle" "(" Target ")" .
ToggleItem ::= ":ToggleItem" "(" Target ItemIndex ")" .
-TransitionTo ::= ":TransitionTo" "(" Target [ConnectionTag]
+TransitionTo ::= ":TransitionTo" "(" Target ConnectionTag?
[TransitionEffect] ")" .
Unload ::= ":Unload" "(" Target ")" .
UnlockScreen ::= ":UnlockScreen" "(" Target ")" .
@@ -820,7 +820,7 @@
NewPaletteRef ::= GenericObjectReference .
NewPortion ::= GenericInteger .
NewReferencedContent ::= ":NewRefContent" "(" GenericContentReference
- [NewContentSize]
+ NewContentSize?
[NewContentCachePriority] ")" .
NewSliderValue ::= GenericInteger .
NewSpeed ::= Rational .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|