projects
/
filters.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Also close bug
[filters.git]
/
nyc.l
diff --git
a/nyc.l
b/nyc.l
index 8505c1652ab79b3e21793130e5aad149db369104..ddc5dbeaa5142e9434d357aaf90e72347a4ab022 100644
(file)
--- a/
nyc.l
+++ b/
nyc.l
@@
-11,6
+11,13
@@
BW [ \t]
SP [ \t]
EW [ \t.,;!\?$]
BW [ \t]
SP [ \t]
EW [ \t.,;!\?$]
+
+%{
+ void plastc(void);
+ char caseify(char);
+ void expletive(void);
+%}
+
%%
".so ".*$ printf("%s", yytext);
[ao]ther printf("%cdder", yytext[0]=='a'?'a':'u');
%%
".so ".*$ printf("%s", yytext);
[ao]ther printf("%cdder", yytext[0]=='a'?'a':'u');
@@
-66,12
+73,13
@@
negro printf("spade");
! printf("! Okay?");
[a-z]"." { printf("%s", yytext);expletive();}
%%
! printf("! Okay?");
[a-z]"." { printf("%s", yytext);expletive();}
%%
-plastc()
+
+void plastc()
{
{
-
unput(yytext[yyleng-1]
);
+
yyunput(yytext[yyleng-1], yytext
);
}
}
-caseify(c)
+c
har c
aseify(c)
char c;
{
if (yytext[0] <= 'Z')
char c;
{
if (yytext[0] <= 'Z')
@@
-83,7
+91,7
@@
char c;
short count = 0;
short which = 0;
short count = 0;
short which = 0;
-expletive()
+
void
expletive()
{
if (count++ % 4 == 0) {
switch (which++ % 5) {
{
if (count++ % 4 == 0) {
switch (which++ % 5) {
@@
-95,3
+103,8
@@
expletive()
}
}
}
}
}
}
+
+int yywrap()
+{
+ return 1;
+}
This page took
0.009916 seconds
and
4
git commands to generate.