[opengtl-commits] [761] parse and lex @operation |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opengtl-commits Archives
]
Revision: 761
Author: cyrille
Date: 2009-05-30 12:38:39 +0200 (Sat, 30 May 2009)
Log Message:
-----------
parse and lex @operation
Modified Paths:
--------------
trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateLexer.cpp
trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateParser.cpp
trunk/OpenGTL/OpenCTL/tests/templates/operation.ctlt
Modified: trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateLexer.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateLexer.cpp 2009-05-30 10:38:24 UTC (rev 760)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateLexer.cpp 2009-05-30 10:38:39 UTC (rev 761)
@@ -43,6 +43,7 @@
IDENTIFIER_IS_KEYWORD( "colorchannels", COLORCHANNELS );
IDENTIFIER_IS_KEYWORD( "alphachannel", ALPHACHANNEL );
IDENTIFIER_IS_KEYWORD( "alpha", ALPHA );
+ IDENTIFIER_IS_KEYWORD( "operation", OPERATION );
IDENTIFIER_IS_KEYWORD( "type", TYPE );
IDENTIFIER_IS_KEYWORD( "max", MAX );
IDENTIFIER_IS_KEYWORD( "min", MIN );
Modified: trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateParser.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateParser.cpp 2009-05-30 10:38:24 UTC (rev 760)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateParser.cpp 2009-05-30 10:38:39 UTC (rev 761)
@@ -74,15 +74,23 @@
nodes.push_back( parseAllChannels( AllChannelsNode::AlphaChannel ) );
break;
case Token::MAX:
+ getNextToken();
nodes.push_back( new NamedMaxNode( parseName() ) );
break;
case Token::MIN:
+ getNextToken();
nodes.push_back( new NamedMinNode( parseName() ) );
break;
+ case Token::OPERATION:
+ getNextToken();
+ nodes.push_back( new OperationNode( parseName() ) );
+ break;
case Token::UNIT:
+ getNextToken();
nodes.push_back( new NamedUnitNode( parseName() ) );
break;
case Token::TYPE:
+ getNextToken();
nodes.push_back( new NamedTypeNode( parseName() ) );
break;
default:
Modified: trunk/OpenGTL/OpenCTL/tests/templates/operation.ctlt
===================================================================
--- trunk/OpenGTL/OpenCTL/tests/templates/operation.ctlt 2009-05-30 10:38:24 UTC (rev 760)
+++ trunk/OpenGTL/OpenCTL/tests/templates/operation.ctlt 2009-05-30 10:38:39 UTC (rev 761)
@@ -1,3 +1,4 @@
+@operation(transformation)
{
@allchannels( @type @var(interm) = @in * 0.5;
) @colorchannels(@out = @var(interm) + 2;