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
892ac32a
Commit
892ac32a
authored
Oct 02, 2014
by
Sarah Spall
Committed by
Vikram Narayanan
Oct 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updating repo to reflect the file reorganizaiton on my computer
parent
78f016d1
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
188 additions
and
6 deletions
+188
-6
tools/lcd/idl/include/code_generator.h
tools/lcd/idl/include/code_generator.h
+9
-0
tools/lcd/idl/include/header_generator.h
tools/lcd/idl/include/header_generator.h
+0
-0
tools/lcd/idl/include/lcd_ast.h
tools/lcd/idl/include/lcd_ast.h
+13
-6
tools/lcd/idl/include/lcd_idl.h
tools/lcd/idl/include/lcd_idl.h
+33
-0
tools/lcd/idl/include/marshal_op.h
tools/lcd/idl/include/marshal_op.h
+51
-0
tools/lcd/idl/include/marshal_visitor.h
tools/lcd/idl/include/marshal_visitor.h
+45
-0
tools/lcd/idl/include/scope.h
tools/lcd/idl/include/scope.h
+15
-0
tools/lcd/idl/include/source_generator.h
tools/lcd/idl/include/source_generator.h
+9
-0
tools/lcd/idl/include/stub_generator.h
tools/lcd/idl/include/stub_generator.h
+13
-0
tools/lcd/idl/include/visitor.h
tools/lcd/idl/include/visitor.h
+0
-0
No files found.
tools/lcd/idl/include/code_generator.h
0 → 100644
View file @
892ac32a
#ifndef LCD_HEADER_GENERATOR_H_
#define LCD_HEADER_GENERATOR_H_
#include "lcd_ast.h"
#include <stdio.h>
int
GenerateHeader
(
Scope
*
tree
,
FILE
*
out_file
);
#endif // LCD_HEADER_GENERATOR_H_
tools/lcd/idl/header_generator.h
→
tools/lcd/idl/
include/
header_generator.h
View file @
892ac32a
File moved
tools/lcd/idl/lcd_ast.h
→
tools/lcd/idl/
include/
lcd_ast.h
View file @
892ac32a
...
...
@@ -8,12 +8,18 @@ enum PrimType { kChar = 1, kShort, kInt, kLong, kLongLong, kCapability};
class
Base
{
M_info
info
;
};
class
Scope
:
public
Base
{
// add built in types here, so size can be evaluated before parse
private:
map
<
int
,
Type
>
types_
;
void
init_types
();
public:
Scope
();
lookup_symbol
(
char
*
sym
);
};
class
Type
:
public
Base
...
...
@@ -21,6 +27,7 @@ class Type : public Base
public:
virtual
void
accept
(
ASTVisitor
*
worker
)
=
0
;
virtual
void
marshal
()
=
0
;
virtual
int
size
()
=
0
;
};
class
Typedef
:
public
Type
...
...
@@ -42,8 +49,8 @@ class IntegerType : public Type
int
size_
:
public:
PrimitiveType
(
TypeModifier
type_mod
,
PrimType
primitiv
e
)
{
this
->
type_modifier_
=
type_mod
;
this
->
primitive_
=
primitive
;
}
IntegerType
(
PrimType
type
,
bool
unsigned
,
int
siz
e
)
{
this
->
unsigned_
=
unsigned
;
this
->
type_
=
type
;
this
->
size_
=
size
;
}
virtual
void
accept
(
ASTVisitor
*
worker
)
{
worker
->
visit
(
this
);
}
virtual
void
marshal
();
};
...
...
@@ -95,10 +102,10 @@ class Parameter : public Base
{
Type
*
type_
;
char
*
name_
;
M_info
m
;
public:
Parameter
(
Type
*
type
,
char
*
name
)
{
this
->
type_
=
type
;
this
->
name_
=
name
;
}
{
this
->
type_
=
type
;
this
->
name_
=
name
;
m
=
new
M_info
();
}
~
Parameter
();
void
accept
(
ASTVisitor
*
worker
)
{
worker
->
visit
(
this
);
}
};
...
...
tools/lcd/idl/include/lcd_idl.h
0 → 100644
View file @
892ac32a
#ifndef _peg_Parser_
#define _peg_Parser_
#include <string>
namespace
Parser
{
/* filename should be a path to a file */
extern
const
void
*
parse
(
const
std
::
string
&
filename
,
bool
stats
=
false
);
/* data contains the bytes that will be parsed */
extern
const
void
*
parse
(
const
char
*
data
,
bool
stats
=
false
);
/* ParseException can be thrown by the parser in case of parser failure */
class
ParseException
:
public
std
::
exception
{
public:
std
::
string
getReason
()
const
;
int
getLine
()
const
;
int
getColumn
()
const
;
virtual
~
ParseException
()
throw
();
};
}
/* Parser */
#endif
tools/lcd/idl/include/marshal_op.h
0 → 100644
View file @
892ac32a
#ifndef MARSHAL_OP
#define MARSHAL_OP
class
M_info
{
size_t
size_
;
};
class
M_rpc
:
public
M_info
{
/*
bool regs[LCD_MAX_REGS];
bool cap_regs[LCD_MAX_CAP_REGS]; */
public:
M_rpc
();
};
class
M_proj
:
public
M_info
{
public:
M_proj
(
size_t
size
)
{
size_
=
size
;
}
};
class
M_param
:
public
M_info
{
int
reg
;
int
size
;
public:
M_param
();
init
(
int
size
,
int
reg
);
};
class
M_projType
:
public
M_info
{
public:
M_projType
(
size_t
size
)
{
size_
=
size
;
}
};
class
M_intType
:
public
M_info
{
public:
M_intType
(
size_t
size
)
{
size_
=
size
;
}
};
class
M_pointerType
:
public
M_info
{
public:
M_pointerType
(
size_t
size
)
{
size_
=
size
;
}
};
tools/lcd/idl/include/marshal_visitor.h
0 → 100644
View file @
892ac32a
#ifndef _MARSHAL_
#define _MARHSAL_
#include "visitor.h"
class
MarshalVisitor
:
public
ASTVisitor
{
bool
regs
[
LCD_MAX_REGS
];
bool
cap_regs
[
LCD_MAX_CAP_REGS
];
int
find_free_reg
();
void
set_reg_used
(
int
reg
);
public:
virtual
void
visit
(
File
*
file
);
// virtual void visit(Message *message);
// virtual void visit(MessageField *message_field);
virtual
void
visit
(
ProjectionField
*
proj_field
);
virtual
void
visit
(
Rpc
*
rpc
);
virtual
void
visit
(
Parameter
*
parameter
);
// Types
virtual
void
visit
(
ProjectionType
*
proj_type
);
virtual
void
visit
(
IntegerType
*
this
);
virtual
void
visit
(
PointerType
*
this
);
virtual
void
visit
(
Typedef
*
this
);
MarshalVisitor
();
};
class
packVisitor
:
public
ASTVisitor
{
public:
virtual
void
visit
(
File
*
file
);
// virtual void visit(Message *message);
// virtual void visit(MessageField *message_field);
virtual
void
visit
(
ProjectionField
*
proj_field
);
virtual
void
visit
(
Rpc
*
rpc
);
virtual
void
visit
(
Parameter
*
parameter
);
// Types
virtual
void
visit
(
ProjectionType
*
proj_type
);
virtual
void
visit
(
IntegerType
*
this
);
virtual
void
visit
(
PointerType
*
this
);
virtual
void
visit
(
Typedef
*
this
);
packVisitor
();
};
#endif
tools/lcd/idl/include/scope.h
0 → 100644
View file @
892ac32a
#ifndef SCOPE_H
#define SCOPE_H
#include "lcd_ast.h"
class
Root_scope
:
public
Scope
{
static
Root_scope
*
instance_
;
Root_scope
();
public:
static
Root_scope
*
instance
();
something
lookup_symbol
(
char
*
type
);
something
insert_symbol
(
char
*
type
,
value
);
}
#endif
tools/lcd/idl/include/source_generator.h
0 → 100644
View file @
892ac32a
#ifndef LCD_SOURCE_GENERATOR_H_
#define LCD_SOURCE_GENERATOR_H_
#include "lcd_ast.h"
#include <stdio.h>
int
GenerateSource
(
Scope
*
tree
,
FILE
*
out_file
);
#endif // LCD_SOURCE_GENERATOR_H_
tools/lcd/idl/include/stub_generator.h
0 → 100644
View file @
892ac32a
#ifndef _STUB_GENERATOR_
#define _STUB_GENERATOR_
#include "ast.h"
#include "header-generator.h"
#include <stdio.h>
#include <cstring>
#include <cstdlib>
int
generate_stub_file
(
Interface
*
i
,
FILE
*
f_out
);
#endif
tools/lcd/idl/visitor.h
→
tools/lcd/idl/
include/
visitor.h
View file @
892ac32a
File moved
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