projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fine tune per architecture facilities
[lttv.git]
/
ltt
/
branches
/
poly
/
ltt
/
parser.c
diff --git
a/ltt/branches/poly/ltt/parser.c
b/ltt/branches/poly/ltt/parser.c
index 921c559ae5fed7e131107fc14f79db99d33b6fce..6dbf402d76fd4f008f8d8c5cce17378df0617b15 100644
(file)
--- a/
ltt/branches/poly/ltt/parser.c
+++ b/
ltt/branches/poly/ltt/parser.c
@@
-267,6
+267,7
@@
void getFacilityAttributes(parse_file_t *in, facility_t *fac)
char car;
fac->name = NULL;
char car;
fac->name = NULL;
+ fac->arch = NULL;
while(1) {
token = getToken(in);
while(1) {
token = getToken(in);
@@
-281,7
+282,12
@@
void getFacilityAttributes(parse_file_t *in, facility_t *fac)
if(car == EOF) in->error(in,"name was expected");
else if(car == '\"') fac->name = allocAndCopy(getQuotedString(in));
else fac->name = allocAndCopy(getName(in));
if(car == EOF) in->error(in,"name was expected");
else if(car == '\"') fac->name = allocAndCopy(getQuotedString(in));
else fac->name = allocAndCopy(getName(in));
- }
+ } else if(!strcmp("arch", token)) {
+ getEqual(in);
+ car = seekNextChar(in);
+ if(car == '\"') fac->name = allocAndCopy(getQuotedString(in));
+ else fac->arch = allocAndCopy(getName(in));
+ }
}
}
}
}
@@
-420,7
+426,7
@@
void parseFacility(parse_file_t *in, facility_t * fac)
getFacilityAttributes(in, fac);
if(fac->name == NULL) in->error(in, "Attribute not named");
getFacilityAttributes(in, fac);
if(fac->name == NULL) in->error(in, "Attribute not named");
-
+
fac->capname = allocAndCopy(fac->name);
strupper(fac->capname);
getRAnglebracket(in);
fac->capname = allocAndCopy(fac->name);
strupper(fac->capname);
getRAnglebracket(in);
@@
-741,7
+747,7
@@
type_descriptor_t *parseType(parse_file_t *in, type_descriptor_t *inType,
while(strcmp("label",token) == 0){
int *label_value = malloc(sizeof(int));
while(strcmp("label",token) == 0){
int *label_value = malloc(sizeof(int));
- str = allocAndCopy(getNameAttribute(in));
+ str = allocAndCopy(getNameAttribute(in));
token = getValueStrAttribute(in);
sequence_push(&(t->labels),str);
token = getValueStrAttribute(in);
sequence_push(&(t->labels),str);
@@
-972,7
+978,8
@@
char *getName(parse_file_t * in)
char *token;
token = getToken(in);
char *token;
token = getToken(in);
- if(in->type != NAME) in->error(in,"Name token was expected");
+ // Optional descriptions
+ // if(in->type != NAME) in->error(in,"Name token was expected");
return token;
}
return token;
}
@@
-1154,11
+1161,11
@@
char *getToken(parse_file_t * in)
if(pos == BUFFER_SIZE) in->error(in, "number token too large");
in->type = NUMBER;
}
if(pos == BUFFER_SIZE) in->error(in, "number token too large");
in->type = NUMBER;
}
- else if(isal
pha(car)
) {
+ else if(isal
num(car) || car == '_' || car == '-'
) {
in->buffer[0] = car;
pos = 1;
while((car = getc(fp)) != EOF && pos < BUFFER_SIZE) {
in->buffer[0] = car;
pos = 1;
while((car = getc(fp)) != EOF && pos < BUFFER_SIZE) {
- if(!(isalnum(car) || car == '_')) {
+ if(!(isalnum(car) || car == '_'
|| car == '-'
)) {
ungetc(car,fp);
break;
}
ungetc(car,fp);
break;
}
@@
-1550,5
+1557,3
@@
char *appendString(char *s, char *suffix)
strcat(tmp,suffix);
return tmp;
}
strcat(tmp,suffix);
return tmp;
}
-
-
This page took
0.033019 seconds
and
4
git commands to generate.