Passing Arguments [message #756360] |
Sat, 12 November 2011 06:26  |
Eclipse User |
|
|
|
Hi;
I am working on a DSL on my Senior Project. In my senior proect, i m trying to define a language which can express protocols and it's source code are in a git repo(git://github.com/bhdrkn/Protocol-Definition-Language.git). I want to pass argument to allready defined function. To make it simple let say i want to define a grammer like that which is almost same in my senior project's grammer;
[DEFINITIONS]
Argument name
[/DEFINITIONS]
[FUNCTIONS]
function myFirstFunction(Argument arg0)
[/FUNCTIONS]
[CALLS]
call myFirstFunction(name)
[/CALLS]
In order to do that i define this;
FUNCFile:
defines = Defines
functions = Functions
calls = Calls;
Defines:
'[DEFINITIONS]'
definitions+=Define*
'[/DEFINITIONS]';
Define:
name=ID param=ID;
Functions:
'[FUNCTIONS]'
functions+=Function*
'[/FUNCTIONS]' ;
Function:
'function' name=ID '(' (args+=Argument)* ')';
Argument:
keyword=[Define] name=ID;
Calls:
'[CALLS]'
calls+=Call*
'[/CALLS]' ;
Call:
'call' name=[Function];
I'm stuck at calling a function and passing a argument to it. I try many other things but all of them failed. I read other messages about argument passing. But i still have no solution.
I need help
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.18085 seconds