Remove duplicated content.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1916 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1996-10-31 20:39:29 +00:00
parent da7162794b
commit 7171085c19
2 changed files with 1 additions and 138 deletions

View file

@ -72,77 +72,3 @@ endComment \*\/
%%
%{
#include <Foundation/NSObject.h>
#include <Foundation/NSString.h>
#include "stringsfile.tab.h"
#ifdef sfwrap
#undef sfwrap
#endif
int sfwrap()
{
return 1;
}
%}
quote \"
semicolen \;
equals \=
label [a-zA-Z][a-zA-Z0-9_]*
quoted [^"]*\"
whitespace [ \t\n]
startComment \/\*
endComment \*\/
%x QUOTE COMMENT
%%
<COMMENT>{endComment} { BEGIN INITIAL; }
<COMMENT>. ;
<QUOTE>{quoted} {
if (sfleng == 1)
{
BEGIN INITIAL;
sflval.obj = [[[NSString alloc] init] autorelease];
return QUOTED;
}
if (sftext[sfleng - 2] == '\\')
yymore();
else
{
BEGIN INITIAL;
sflval.obj = [[[NSString alloc] initWithCString: sftext length: sfleng - 1] autorelease];
return QUOTED;
}
}
{quote} {BEGIN QUOTE;}
{startComment} {BEGIN COMMENT;}
{label} {
sflval.obj = [NSString stringWithCString: sftext];
return LABEL;
}
{semicolen} {return SEMICOLEN;}
{equals} {return EQUALS;}
{whitespace}+ ;
. { return ERROR; }
%%

View file

@ -59,72 +59,9 @@ int sferror(char *s)
return 0;
}
void
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;
}