Page 1 of 1

eml and structures

PostPosted: Tue Jun 23, 2009 3:02 pm
by jyoung
I have a model that is just a eml function with one input and one output as an example. The code is below.

**********************************************************************
function y = fcn(u)

x = u;

Variable.a = 1;
Variable.b = 1;
Variable.c = 1;

y = Variable.a + Variable.b + Variable.c + x;
*********************************************************************

When I try and transate it I get the follwoing errors ... then a memory access error window pops up and the translation stops. If I remove the structures Variable.a and use just a instead I don't have a problem.

Is there a work around for this or is T-VEC not able to handle this currently? Almost all of my models utilize this type of variable straucture.




-memory-(5) : lexer error 3 :
1:1: Tokens : ( T__82 | T__83 | T__84 | T__85 | T__86 | WS | COMMENT | LINE_CONTINUE | WHILE | IF | ELSEIF | ELSE | FOR | END | BREAK | CONTINUE | RETURN | SWITCH | CASE | OTHERWISE | FUNCTION | SEMI | COLON | STAR | DIV | PLUS | MINUS | POWEROF | LT_a | LTE | GT | GTE | EQUAL | NOT_EQUAL | NOT | LOR | LXOR | LAND | ASSIGN | LPAREN | RPAREN | COMMA | NEWLINE | PRIME | MATRIXPRIME | HexLiteral | DecimalLiteral | OctalLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | Identifier | IdentifierPrimed ); at offset 10, near 'a' :
a = 1;
Variable.b =
-memory-(6) : lexer error 3 :
1:1: Tokens : ( T__82 | T__83 | T__84 | T__85 | T__86 | WS | COMMENT | LINE_CONTINUE | WHILE | IF | ELSEIF | ELSE | FOR | END | BREAK | CONTINUE | RETURN | SWITCH | CASE | OTHERWISE | FUNCTION | SEMI | COLON | STAR | DIV | PLUS | MINUS | POWEROF | LT_a | LTE | GT | GTE | EQUAL | NOT_EQUAL | NOT | LOR | LXOR | LAND | ASSIGN | LPAREN | RPAREN | COMMA | NEWLINE | PRIME | MATRIXPRIME | HexLiteral | DecimalLiteral | OctalLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | Identifier | IdentifierPrimed ); at offset 10, near 'b' :
b = 1;
Variable.c =
-memory-(7) : lexer error 3 :
1:1: Tokens : ( T__82 | T__83 | T__84 | T__85 | T__86 | WS | COMMENT | LINE_CONTINUE | WHILE | IF | ELSEIF | ELSE | FOR | END | BREAK | CONTINUE | RETURN | SWITCH | CASE | OTHERWISE | FUNCTION | SEMI | COLON | STAR | DIV | PLUS | MINUS | POWEROF | LT_a | LTE | GT | GTE | EQUAL | NOT_EQUAL | NOT | LOR | LXOR | LAND | ASSIGN | LPAREN | RPAREN | COMMA | NEWLINE | PRIME | MATRIXPRIME | HexLiteral | DecimalLiteral | OctalLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | Identifier | IdentifierPrimed ); at offset 10, near 'c' :
c = 1;



y = Variab
-memory-(11) : lexer error 3 :
1:1: Tokens : ( T__82 | T__83 | T__84 | T__85 | T__86 | WS | COMMENT | LINE_CONTINUE | WHILE | IF | ELSEIF | ELSE | FOR | END | BREAK | CONTINUE | RETURN | SWITCH | CASE | OTHERWISE | FUNCTION | SEMI | COLON | STAR | DIV | PLUS | MINUS | POWEROF | LT_a | LTE | GT | GTE | EQUAL | NOT_EQUAL | NOT | LOR | LXOR | LAND | ASSIGN | LPAREN | RPAREN | COMMA | NEWLINE | PRIME | MATRIXPRIME | HexLiteral | DecimalLiteral | OctalLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | Identifier | IdentifierPrimed ); at offset 14, near 'a' :
a + Variable.b + Var
-memory-(11) : lexer error 3 :
1:1: Tokens : ( T__82 | T__83 | T__84 | T__85 | T__86 | WS | COMMENT | LINE_CONTINUE | WHILE | IF | ELSEIF | ELSE | FOR | END | BREAK | CONTINUE | RETURN | SWITCH | CASE | OTHERWISE | FUNCTION | SEMI | COLON | STAR | DIV | PLUS | MINUS | POWEROF | LT_a | LTE | GT | GTE | EQUAL | NOT_EQUAL | NOT | LOR | LXOR | LAND | ASSIGN | LPAREN | RPAREN | COMMA | NEWLINE | PRIME | MATRIXPRIME | HexLiteral | DecimalLiteral | OctalLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | Identifier | IdentifierPrimed ); at offset 27, near 'b' :
b + Variable.c + x;
-memory-(11) : lexer error 3 :
1:1: Tokens : ( T__82 | T__83 | T__84 | T__85 | T__86 | WS | COMMENT | LINE_CONTINUE | WHILE | IF | ELSEIF | ELSE | FOR | END | BREAK | CONTINUE | RETURN | SWITCH | CASE | OTHERWISE | FUNCTION | SEMI | COLON | STAR | DIV | PLUS | MINUS | POWEROF | LT_a | LTE | GT | GTE | EQUAL | NOT_EQUAL | NOT | LOR | LXOR | LAND | ASSIGN | LPAREN | RPAREN | COMMA | NEWLINE | PRIME | MATRIXPRIME | HexLiteral | DecimalLiteral | OctalLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | Identifier | IdentifierPrimed ); at offset 40, near 'c' :
c + x;
-memory-(5) : error 3 : , at offset 8
near [Index: 16 (Start: 70676094-Stop: 70676095) ='.a', type<26> Line: 5 LinePos:8]
: cannot match to any predicted input...
-memory-(6) : error 3 : , at offset 8
near [Index: 22 (Start: 70676110-Stop: 70676111) ='.b', type<26> Line: 6 LinePos:8]
: cannot match to any predicted input...
-memory-(7) : error 3 : , at offset 8
near [Index: 28 (Start: 70676126-Stop: 70676127) ='.c', type<26> Line: 7 LinePos:8]
: cannot match to any predicted inpu

Re: eml and structures

PostPosted: Tue Jun 23, 2009 3:27 pm
by busser
Unfortunately, we do not yet provide support for the dynamic creation of structured variables in EML functions. We have not yet seen a customer request for this aspect of EML, consequently support for it is still on our to-do list.

If I remove the structures Variable.a and use just a instead I don't have a problem.
Is there a work around for this or is T-VEC not able to handle this currently? Almost all of my models utilize this type of variable straucture.


The only thing I can suggest at this time would be replacing the "." with "_" for the time being.

**********************************************************************
function y = fcn(u)

x = u;

Variable_a = 1;
Variable_b = 1;
Variable_c = 1;

y = Variable_a + Variable_b + Variable_c + x;

Then convert back to the original structure form after support has been added.

Support for this would not be difficult, it has just be a matter of priorities. Since there have been no customer requests for this feature to date, it has been rather low. We will plan on making it available in the next release - due around Sept. 1.

Re: eml and structures

PostPosted: Tue Jun 23, 2009 4:22 pm
by jyoung
ok

I woudl be happy to beta test the feature prior to your next release if you woudl like.

Thanks for the info