projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup parser code, add some node IDs to AST
[babeltrace.git]
/
formats
/
ctf
/
metadata
/
ctf-parser.y
diff --git
a/formats/ctf/metadata/ctf-parser.y
b/formats/ctf/metadata/ctf-parser.y
index 0b425cb9a84148a38d752390c7918db572e3f654..38031b007d851cb8082703b556c7ee921c544e03 100644
(file)
--- a/
formats/ctf/metadata/ctf-parser.y
+++ b/
formats/ctf/metadata/ctf-parser.y
@@
-70,31
+70,32
@@
void setstring(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src)
strcpy(lvalp->gs->s, src);
}
strcpy(lvalp->gs->s, src);
}
-static void init_scope(struct scope *scope, struct scope *parent)
+static void init_scope(struct ctf_scanner_scope *scope,
+ struct ctf_scanner_scope *parent)
{
scope->parent = parent;
scope->types = g_hash_table_new_full(g_str_hash, g_str_equal,
(GDestroyNotify) free, NULL);
}
{
scope->parent = parent;
scope->types = g_hash_table_new_full(g_str_hash, g_str_equal,
(GDestroyNotify) free, NULL);
}
-static void finalize_scope(struct scope *scope)
+static void finalize_scope(struct
ctf_scanner_
scope *scope)
{
g_hash_table_destroy(scope->types);
}
static void push_scope(struct ctf_scanner *scanner)
{
{
g_hash_table_destroy(scope->types);
}
static void push_scope(struct ctf_scanner *scanner)
{
- struct scope *ns;
+ struct
ctf_scanner_
scope *ns;
printf_dbg_noarg("push scope\n");
printf_dbg_noarg("push scope\n");
- ns = malloc(sizeof(struct scope));
+ ns = malloc(sizeof(struct
ctf_scanner_
scope));
init_scope(ns, scanner->cs);
scanner->cs = ns;
}
static void pop_scope(struct ctf_scanner *scanner)
{
init_scope(ns, scanner->cs);
scanner->cs = ns;
}
static void pop_scope(struct ctf_scanner *scanner)
{
- struct scope *os;
+ struct
ctf_scanner_
scope *os;
printf_dbg_noarg("pop scope\n");
os = scanner->cs;
printf_dbg_noarg("pop scope\n");
os = scanner->cs;
@@
-103,7
+104,7
@@
static void pop_scope(struct ctf_scanner *scanner)
free(os);
}
free(os);
}
-static int lookup_type(struct scope *s, const char *id)
+static int lookup_type(struct
ctf_scanner_
scope *s, const char *id)
{
int ret;
{
int ret;
@@
-114,7
+115,7
@@
static int lookup_type(struct scope *s, const char *id)
int is_type(struct ctf_scanner *scanner, const char *id)
{
int is_type(struct ctf_scanner *scanner, const char *id)
{
- struct scope *it;
+ struct
ctf_scanner_
scope *it;
int ret = 0;
for (it = scanner->cs; it != NULL; it = it->parent) {
int ret = 0;
for (it = scanner->cs; it != NULL; it = it->parent) {
@@
-349,16
+350,12
@@
event_declaration:
event_declaration_begin:
EVENT LBRAC
event_declaration_begin:
EVENT LBRAC
- {
- push_scope(scanner);
- }
+ { push_scope(scanner); }
;
event_declaration_end:
RBRAC SEMICOLON
;
event_declaration_end:
RBRAC SEMICOLON
- {
- pop_scope(scanner);
- }
+ { pop_scope(scanner); }
;
;
@@
-369,16
+366,12
@@
stream_declaration:
stream_declaration_begin:
STREAM LBRAC
stream_declaration_begin:
STREAM LBRAC
- {
- push_scope(scanner);
- }
+ { push_scope(scanner); }
;
stream_declaration_end:
RBRAC SEMICOLON
;
stream_declaration_end:
RBRAC SEMICOLON
- {
- pop_scope(scanner);
- }
+ { pop_scope(scanner); }
;
;
@@
-389,16
+382,12
@@
trace_declaration:
trace_declaration_begin:
TRACE LBRAC
trace_declaration_begin:
TRACE LBRAC
- {
- push_scope(scanner);
- }
+ { push_scope(scanner); }
;
trace_declaration_end:
RBRAC SEMICOLON
;
trace_declaration_end:
RBRAC SEMICOLON
- {
- pop_scope(scanner);
- }
+ { pop_scope(scanner); }
;
declaration_specifiers:
;
declaration_specifiers:
@@
-452,16
+441,12
@@
struct_type_specifier:
struct_declaration_begin:
LBRAC
struct_declaration_begin:
LBRAC
- {
- push_scope(scanner);
- }
+ { push_scope(scanner); }
;
struct_declaration_end:
RBRAC
;
struct_declaration_end:
RBRAC
- {
- pop_scope(scanner);
- }
+ { pop_scope(scanner); }
;
variant_type_specifier:
;
variant_type_specifier:
@@
-482,16
+467,12
@@
variant_type_specifier:
variant_declaration_begin:
LBRAC
variant_declaration_begin:
LBRAC
- {
- push_scope(scanner);
- }
+ { push_scope(scanner); }
;
variant_declaration_end:
RBRAC
;
variant_declaration_end:
RBRAC
- {
- pop_scope(scanner);
- }
+ { pop_scope(scanner); }
;
type_specifier_or_integer_constant:
;
type_specifier_or_integer_constant:
@@
-606,9
+587,7
@@
type_declarator:
direct_type_declarator:
IDENTIFIER
direct_type_declarator:
IDENTIFIER
- {
- add_type(scanner, $1->s);
- }
+ { add_type(scanner, $1->s); }
| LPAREN type_declarator RPAREN
| direct_type_declarator LSBRAC type_specifier_or_integer_constant RSBRAC
;
| LPAREN type_declarator RPAREN
| direct_type_declarator LSBRAC type_specifier_or_integer_constant RSBRAC
;
@@
-621,9
+600,7
@@
abstract_type_declarator:
direct_abstract_type_declarator:
/* empty */
| IDENTIFIER
direct_abstract_type_declarator:
/* empty */
| IDENTIFIER
- {
- add_type(scanner, $1->s);
- }
+ { add_type(scanner, $1->s); }
| LPAREN abstract_type_declarator RPAREN
| direct_abstract_type_declarator LSBRAC type_specifier_or_integer_constant RSBRAC
| direct_abstract_type_declarator LSBRAC RSBRAC
| LPAREN abstract_type_declarator RPAREN
| direct_abstract_type_declarator LSBRAC type_specifier_or_integer_constant RSBRAC
| direct_abstract_type_declarator LSBRAC RSBRAC
This page took
0.024652 seconds
and
4
git commands to generate.