Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xcap-capability-linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xcap
xcap-capability-linux
Commits
b96b5e6d
Commit
b96b5e6d
authored
Sep 27, 2015
by
Sarah Spall
Committed by
Vikram Narayanan
Oct 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first changes to parser, incomplete because need new data structures
parent
c754c320
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
tools/lcd/idl/parser/lcd_idl.peg
tools/lcd/idl/parser/lcd_idl.peg
+18
-5
No files found.
tools/lcd/idl/parser/lcd_idl.peg
View file @
b96b5e6d
...
...
@@ -99,7 +99,7 @@ IdentStart = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]
IdentCont = IdentStart | [0123456789]
File = Spacing v:Verbatim? d:Type_Definitions* t:
Rpc
* <eof> {{
File = Spacing v:Verbatim? d:Type_Definitions* t:
Interface
* <eof> {{
std::vector<Rpc *> rpcs;
printf("in file matched everything\n");
for(Value::iterator it = t.getValues().begin(); it != t.getValues().end(); it ++)
...
...
@@ -112,6 +112,11 @@ File = Spacing v:Verbatim? d:Type_Definitions* t:Rpc* <eof> {{
}
value = new File((char*) v.getValue(), current_file_scope(), rpcs); }}
Interface = "interface" Space+ id:Identifier Spacing OPEN globals:Parameters Spacing CLOSE Spacing OPENC Spacing d:Type_Definitions* r:Rpc* Spacing CLOSEC Spacing {{ // todo
}}
Typedef = "typedef" Spacing "<" Spacing rt:RealType Spacing "," Spacing mt:Type_form ">" Spacing id:Identifier Spacing {{
Typedef * val = new Typedef((char*) rt.getValue(), (Type*) mt.getValue());
insertType((char*)id.getValue(),val);
...
...
@@ -207,16 +212,22 @@ Parameters = f:FirstParam* l:LastParam {{ printf("in param\n");
params->push_back((Parameter* ) l.getValue());
value = params; }}
function_pointer = "rpc" Space+ OPENS k:Keyword* CLOSES Spacing rt:Type_form Spacing OPEN Spacing "*" Spacing id:Identifer CLOSE Spacing OPEN p:Parameters CLOSE SEMI Spacing {{
//todo
}}
Rpc = "rpc" Space+ t:Type_form id1:Identifier Spacing OPEN p:Parameters CLOSE SEMI Spacing {{
printf("rpc value of id is: %s\n", (char *) id1.getValue());
//
printf("rpc value of id is: %s\n", (char *) id1.getValue());
std::vector<Parameter*>* params = (std::vector<Parameter*>*) p.getValue();
std::vector<Parameter*> params_ = *params;
printf("before rpc\n");
Rpc* r = new Rpc(
(Type *) t.getValue(
), (char *) id1.getValue(), params_);
printf("after rpc\n");
//
printf("before rpc\n");
Rpc* r = new Rpc(
new ReturnValue((Type *) t.getValue()
), (char *) id1.getValue(), params_);
//
printf("after rpc\n");
value = r; }}
Projection_constructor = "projection" Space+ id:Identifer Spacing "<" Spacing t:Proj_type ">" Spacing OPEN Spacing p:Parameters Spacing CLOSE Spacing OPENC Spacing // todo Spacing CLOSEC Spacing {{
//todo
}}
Projection = "projection" Space+ id:Identifier Spacing "<" Spacing t:Proj_type ">" Spacing OPENC Spacing p:ProjField+ CLOSEC Spacing {{ std::vector<ProjectionField *> p_fields;
for(Value::iterator it = p.getValues().begin(); it != p.getValues().end(); it ++)
...
...
@@ -357,6 +368,8 @@ Type_form = "projection" Space+ n:Identifier Space* "*" Spacing {{
| "projection" Space+ name:Identifier Space+ {{
printf("calling getType 1\n");
value = getType((char*)name.getValue()); }}
| "channel" {{ // todo
}}
| type
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment