libs-base/Source/stringsfile.y
Andrew McCallum 9150d93f9c New file.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1882 72102866-910b-0410-8b05-ffd578937521
1996-10-31 17:05:21 +00:00

130 lines
1.4 KiB
Text

%{
#include <Foundation/NSObject.h>
#include <Foundation/NSString.h>
#include <Foundation/NSDictionary.h>
static NSMutableDictionary *properties;
%}
%token <obj> QUOTED LABEL
%token SEMICOLEN EQUALS ERROR
%union {
id obj;
}
%type <obj> value
%%
file: asignments
{
return 1;
}
| error
{
return 0;
}
| ERROR
{
return 0;
};
asignments: asignment
| asignments asignment
;
asignment: value EQUALS value SEMICOLEN
{
[(NSMutableDictionary *)properties setObject: $3 forKey: (NSString *) $1];
}
;
value: LABEL
{
$$ = $1;
}
| QUOTED
{
$$ = $1;
};
%%
int sferror(char *s)
{
return 0;
}
sfSetDict(NSMutableDictionary *aDict)
{
properties = aDict;
}
%{
#include <Foundation/NSObject.h>
#include <Foundation/NSString.h>
#include <Foundation/NSDictionary.h>
static NSMutableDictionary *properties;
%}
%token <obj> QUOTED LABEL
%token SEMICOLEN EQUALS ERROR
%union {
id obj;
}
%type <obj> value
%%
file: asignments
{
return 1;
}
| error
{
return 0;
}
| ERROR
{
return 0;
};
asignments: asignment
| asignments asignment
;
asignment: value EQUALS value SEMICOLEN
{
[(NSMutableDictionary *)properties setObject: $3 forKey: (NSString *) $1];
}
;
value: LABEL
{
$$ = $1;
}
| QUOTED
{
$$ = $1;
};
%%
int sferror(char *s)
{
return 0;
}
sfSetDict(NSMutableDictionary *aDict)
{
properties = aDict;
}