Top Banner
!" !$% &$%'()*(%"+,-.&*/0+ 122&3+4&" 5&26+&6/ 74%(/)).26 8/92%3/ 74/)/23&3.%2 :::;<= >!!?5 @5; ABBC < D%+"0/4E ?F G+2/ HE ABBC ! "# "%&
28

0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

May 25, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

!"#!$%&$%'()*(%"+,-.&*/0+

122&3+4&"#5&26+&6/#74%(/)).26

8/92%3/#74/)/23&3.%2#:::;<=>!!?5#@5; ABBC#< D%+"0/4E#?F

G+2/#HE#ABBC! "#$"%&

Page 2: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

!"#$%"&'(")*$"*+,

-'!"#$%"&'&"!($"() .,'"'/0%1'0/'2011$).2"#.0)'3+2$&."%'#0'4$1")5.)67'89.5.3+6.":

;03$&"%',305+)')"#$%"&'&")*$"*+,<

=4.)+,+ >?@AB1 ;0%#$*$+,+ >CD1E3").,4 F@@1 G+)*"&. >C>1H)*&.,4 FAI1 J$,,.") >KB1-%"L.2 @AM1 N"3")+,+ >@@1O.)6. >AD1 P+%1") IB1

89.5.3+6.":

H#4)0&0*$+ 2"#"&0*,'M?I>@'5)0Q)'&.R.)*'&")*$"*+,7

! "#$"%&

Page 3: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

=0)&")*,<'S"6+TU3'(")*$"*+,'

V5%+)# &.,#,'BAA'.)R+)#+6'&")*$"*+, .)2&$6.)*<

' (.)*$"'W*)0#" 8O.&6+*""%6 0/'G.)*+)?'27'>>BA:' H,3+%")#0'8(7'X"1+)40/?'>DDC:'Y&.)*0) 8S7'V5%")6?'>IDK:O$Z U,[3#\ P[1 ]W'&0R+'\0$^

' ;%0#0T=+)#%"&'S0$)#".)'8N7'G$%5+?'@AAC:'_%.#05 8_7'G00`+%?'@AAC:(")*$"*+'0/'#4+'_%$,4+5?'&0)*T#".&+6'L+.)*,'Q.#4'&"%*+'+"%,'")6')0'R02"&'20%6,

8-%.5" V5%+)#?'*!'#+)',"!-'./'*!0)!#)-',"!($"()1?'@AAI:84##3<aaQQQ7.)#4+&")60/.)R+)#+6&")*$"*+,7201:

( "#$"%&

Page 4: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

;%0*%"11.)*'(")*$"*+,

;%0*%"11.)*'&")*$"*+, "%+')0#"#.0),'/0%'6+,2%.L.)*'2013$#"#.0),'#0'3+03&+'")6'#0'1"24.)+,7

U)6+%&\.)*'+R+%\'3%0*%"11.)*'&")*$"*+'.,'"'106+&'0/'2013$#"#.0)<

;%02+6$%"&<'=?'=bb?'=c?'N"R"

_+2&"%"#.R+<'Ed(

(0*.2<';%0&0*

e$)2#.0)"&<'O",5+&&

E2%.3#.)*<'-9Y?';+%&?';\#40)?'J$L\

) "#$"%&

Page 5: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

;%0*%"11.)*'(")*$"*+,f4+%+'"%+'1")\'#40$,")6,'0/'3%0*%"11.)*'&")*$"*+,7

f.0L+g, #+)'10,#'303$&"%'&")*$"*+,'/0%'S"\'@AAI<>7'N"R" M7';\#40)

@7'= C7'=c

F7'=bb D7'N"R"E2%.3#

K7';O; I7';+%&

B7'h.,$"&'G",.2 >A7'J$L\84##3<aaQQQ7#.0L+7201:

4##3<aaQQQ7IITL0##&+,T0/TL++%7)+# 4",'3%0*%"1,'.)'>?@C>'6.//+%+)#'3%0*%"11.)*'&")*$"*+,'#0'3%.)#'0$#'#4+'&\%.2,'#0'iII'G0##&+,'0/'G++%7j

* "#$"%&

Page 6: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

iII'G0##&+,'0/'G++%j!!"#$%%&'("$)"#''*"$+"%,'"-.&&/"!!"#$%%&'("$)"#''*01.2'"$+'"3$-+".+3"4.(("5%".*$6+3/"!7"#$%%&'("$)"#''*"$+"%,'"-.&&0

!7"#$%%&'("$)"#''*"$+"%,'"-.&&/"!7"#$%%&'("$)"#''*01.2'"$+'"3$-+".+3"4.(("5%".*$6+3/"!8"#$%%&'("$)"#''*"$+"%,'"-.&&0

000

9"#$%%&'("$)"#''*"$+"%,'"-.&&/"9"#$%%&'("$)"#''*01.2'"$+'"3$-+".+3"4.(("5%".*$6+3/":"#$%%&'"$)"#''*"$+"%,'"-.&&0

:"#$%%&'"$)"#''*"$+"%,'"-.&&/":"#$%%&'"$)"#''*01.2'"$+'"3$-+".+3"4.(("5%".*$6+3/"+$";$*'"#$%%&'("$)"#''*"$+"%,' -.&&0

<$";$*'"#$%%&'("$)"#''*"$+"%,'"-.&&/"+$";$*'"#$%%&'("$)"#''*0=$"%$"%,'"(%$*'".+3"#6>"($;'";$*'/"!!"#$%%&'("$)"#''*"$+"%,'"-.&&0

8f%"6.#.0)"&:+ "#$"%&

Page 7: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

iII'G0##&+,'0/'G++%j .)'-9YBEGIN {for(i = 99; i >= 0; i--) {print ubottle(i), "on the wall,", lbottle(i) "."print action(i), lbottle(inext(i)), "on the wall."print

}}function ubottle(n) {return sprintf("%s bottle%s of beer", n ? n : "No more", n - 1 ? "s" : "")

}function lbottle(n) {return sprintf("%s bottle%s of beer", n ? n : "no more", n - 1 ? "s" : "")

}function action(n) {return sprintf("%s", n ? "Take one down and pass it around," : \

"Go to the store and buy some more,")}function inext(n) {return n ? n - 1 : 99

}8V,"1$'-05.?''4##3<aa3+03&+76+L.")70%*ak0,"1$:

, "#$"%&

Page 8: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

iII'G0##&+,'0/'G++%j .)';+%&''=~( '(?{' .('`' |'%') .('[' ^'-').('`' |'!') .('`' |',') .'"'. '\\$'.'==' .('[' ^'+') .('`' |'/') .('['^'+') .'||' .(';' &'=') .(';' &'=').';-' .'-'. '\\$' .'=;' .('[' ^'(').('[' ^'.') .('`' |'"') .('!' ^'+').'_\\{' .'(\\$' .';=('. '\\$=|' ."\|".( '`'^'.'

).(('`')| '/').').' .'\\"'.+( '{'^'['). ('`'|'"') .('`'|'/').('['^'/') .('['^'/'). ('`'|',').( '`'|('%')). '\\".\\"'.( '['^('(')).'\\"'.('['^ '#').'!!--' .'\\$=.\\"' .('{'^'['). ('`'|'/').( '`'|"\&").('{'^"\[").( '`'|"\"").( '`'|"\%").( '`'|"\%").( '['^(')')). '\\").\\"'.('{'^'[').( '`'|"\/").( '`'|"\.").( '{'^"\[").( '['^"\/").( '`'|"\(").('`'|"\%").( '{'^"\[").( '['^"\,").( '`'|"\!").( '`'|"\,").( '`'|(',')).'\\"\\}'.+( '['^"\+").( '['^"\)").( '`'|"\)").( '`'|"\.").( '['^('/')).'+_,\\",'.( '{'^('[')). ('\\$;!').( '!'^"\+").( '{'^"\/").( '`'|"\!").('`'|"\+").( '`'|"\%").( '{'^"\[").( '`'|"\/").( '`'|"\.").( '`'|"\%").('{'^"\[").( '`'|"\$").( '`'|"\/").( '['^"\,").( '`'|('.')). ','.(('{')^'[').("\["^ '+').("\`"| '!').("\["^ '(').("\["^ '(').("\{"^ '[').("\`"|')').("\["^ '/').("\{"^ '[').("\`"| '!').("\["^ ')').("\`"| '/').("\["^'.').("\`"| '.').("\`"| '$')."\,".( '!'^('+')). '\\",_,\\"' .'!'.("\!"^'+').("\!"^ '+').'\\"'. ('['^',').( '`'|"\(").( '`'|"\)").( '`'|"\,").('`'|('%')). '++\\$="})' );$:=('.')^ '~';$~='@'| '(';$^=')'^ '[';$/='`';

8-)6%+Q'E"R"*+?'4##3<aa,+"%24723")70%*a6.,#a-21+TH\+_%03,a&.La-21+aH\+_%03,731:- "#$"%&

Page 9: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

iII'G0##&+,'0/'G++%j .)'#4+'94.#+,3"2+'(")*$"*+

8H6Q.)'G%"6\'")6'=4%.,'S0%%.,?'U7'_$%4"1:

./ "#$"%&

Page 10: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

-'(.##&+'G.#'0/'e0%1"&'(")*$"*+'f4+0%\

-)'"&2+"3)# .,'"'/.).#+',+#'0/',\1L0&,7lA?'>m?'-E=WW?'U!W=V_H

-'1#%4!( .,'"'/.).#+',+Z$+)2+'0/',\1L0&,7]#4+'+13#\',#%.)*^?'A>A>?'60*?'2"#

-'&"!($"() .,'"'20$)#"L&\ .)/.).#+',+#'0/',#%.)*,'2"&&+6'1)!#)!5)17l'")3) n')' A'm?'''l'1 n'1 .,'"'N"R"'3%0*%"1'm?''l'1 n'1 .,'")'H)*&.,4',+)#+)2+'m

-'&")*$"*+'4",'3%03+%#.+,',$24'",'"'16!#"7 ")6'1)8"!#4517

.. "#$"%&

Page 11: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

(")*$"*+'f%"),&"#.0)

P.R+)'"',0$%2+'&")*$"*+'9?'"'#"%*+#'&")*$"*+':?'")6'"',+)#+)2+'11 .)'.)'99?'?'1"3'1"3'1'4!#.1'4!#. "',+)#+)2+'"',+)#+)2+'# .)'f'#4"#'4",'#4+',"1+'1+").)*'",'17'

.0 "#$"%&

Page 12: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

E3+2./\.)*'E\)#"o<'J+*$&"%'E+#,

J+*$&"%'+o3%+,,.0), *+)+%"#+'#4+'%+*$&"%',+#,"]"n3^p'*+)+%"#+,'"&&',#%.)*,'0/'"g, ")6'3g, L+*.)).)*'Q.#4'")'"

e.).#+'"$#01"#" %+20*).`+'#4+'%+*$&"%',+#,

a,b

.! "#$"%&

/ .a

Page 13: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

E01+'J+*$&"%'E+#,

-&&'Q0%6,'Q.#4'#4+'R0Q+&,'.)'0%6+%facetiously

-&&'Q0%6,'Q.#4'#4+'&+##+%,'.)'.)2%+",.)*'&+o.20*%"34.2'0%6+%aegilops

-&&'Q0%6,'Q.#4')0'&+##+%'022$%%.)*'10%+'#4")'0)2+dermatoglyphics

=011+)#, .)'#4+'3%0*%"11.)*'&")*$"*+'=/* any string without a star followed by a slash */

.( "#$"%&

Page 14: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

E01+'J+*$&"%'Ho3%+,,.0)';"##+%)TS"#24.)*'f00&,

+*%+3

egrep a.*e.*i.*o.*u.*y /usr/dict/words

-9Y

=

N"R"

N"R"E2%.3#

(+o

;+%&

;\#40)

J$L\

.) "#$"%&

Page 15: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

=0)#+o#Te%++'(")*$"*+,

=0)#+o#T/%++'*%"11"%, *+)+%"#+'#4+'=e(,(+#'; L+'#4+'*%"11"%'Q.#4'3%06$2#.0),'9 "939 n'39"9 n' 7

f4+'&")*$"*+'6+)0#+6'L\'; .,'"&&',#%.)*,'0/'"g, ")6'3g, Q.#4'#4+',"1+')$1L+%'0/'"g, ",'3g,7

;"%,.)*'"&*0%.#41, /0%'%+20*).`.)*'#4+'=e(,H"%&+\g, "&*0%.#41

=025+Tq0$)*+%TY","1. "&*0%.#41

f03T60Q)'((]5^'3"%,+%,

G0##01T$3'(J]5^'3"%,+%,

.* "#$"%&

Page 16: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

-1L.*$.#\'.)'P%"11"%,P%"11"%'9 "939 n'39"9 n' *+)+%"#+,'"&&',#%.)*,'0/'"g,")6'3g, Q.#4'#4+',"1+')$1L+%'0/'"g, ",'3g,7

f4.,'*%"11"%'.,'"1L.*$0$,<''"L"L 4",'#Q0'3"%,+'#%++,7

9

"

3 9 " 9

9 3 9

9

939"

" 9 3 9

]"3^! %12 31425$64552nn

n2

11

.+ "#$"%&

Page 17: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

;%0*%"11.)*'(")*$"*+,'"%+')0#W)4+%+)#&\'-1L.*$0$,

f4+'*%"11"%';'*+)+%"#+,'#4+',"1+'&")*$"*+

9 "<39 n'3="9 n'< "<3< n'= 3="= n'

;'.,'$)"1L.*$0$,'")6'4",0)&\'0)+'3"%,+'#%++'/0%+R+%\',+)#+)2+ .)',];^7

9

93<"

" < 3 9

., "#$"%&

Page 18: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

!"#$%"&'(")*$"*+,'"%+'W)4+%+)#&\'-1L.*$0$,

*'8"-)'+)%'-$5>?8B'1+").)*,<'_7'N$%"/,5\ ")6'N7'S"%#.)?'@AAA:

@!)'8.%!4!('*'1+.#'"!')&)2+"!#'4!'86'2"A"8"1?'B.C'+)'(.#'4!#.'86'2"A"8"1'*'-.!D#'>!.C?

8P%0$240 S"%o?'<!48"&'E%"5>)%1?'>IFA:

,41#'#+)'1"&)1'./'#+)'2%.-$5#1'2%.-$5)-'4!'FGHI'C4#+'#+)'2%.-$5#1'2%.-$5)-'4!'FGHJ?

8KBB'3"%,+,<'97'S"%#.)?'Y7'=4$%24?'J7';"#.&?'>IDC:

.- "#$"%&

Page 19: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

S+#406,'/0%'E3+2./\.)*'#4+'E+1")#.2,'0/;%0*%"11.)*'(")*$"*+,

V3+%"#.0)"&',+1")#.2,#%"),&"#.0)'0/'3%0*%"1'20),#%$2#,'#0'")'$)6+%,#006'&")*$"*+

-o.01"#.2',+1")#.2,",,+%#.0),'2"&&+6'3%+20)6.#.0),'")6'30,#20)6.#.0), ,3+2./\'#4+'3%03+%#.+,'0/',#"#+1+)#,

_+)0#"#.0)"& ,+1")#.2,,+1")#.2'/$)2#.0),'1"3',\)#"2#.2'0Lr+2#,'#0',+1")#.2'R"&$+,

0/ "#$"%&

Page 20: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

f%"),&"#.0)'0/';%0*%"11.)*'(")*$"*+,

=013.&+%,0$%2+3%0*%"1

#"%*+#3%0*%"1

78396

&96396

0. "#$"%&

Page 21: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

f"%*+#'(")*$"*+,

-)0#4+%'3%0*%"11.)*'&")*$"*+

=WE=,

JWE=,

h+2#0%'1"24.)+,

S$&#.20%+,

P;U,

d$")#$1'2013$#+%,

00 "#$"%&

Page 22: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

-)'W)#+%3%+#+%'_.%+2#&\'Ho+2$#+,'"'E0$%2+';%0*%"1'0)'.#,'W)3$#

W)#+%3%+#+%

,0$%2+3%0*%"1

0$#3$#

.)3$#

0! "#$"%&

Page 23: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

N"R"'=013.&+%

f%"),&"#0%

,0$%2+'3%0*%"1

0$#3$#.)3$#

N"R"h.%#$"&S"24.)+

.)#+%1+6."#+'%+3%+,+)#"#.0)

0( "#$"%&

Page 24: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

;4",+,'0/'"'=&",,.2"&'=013.&+%

E+1")#.2-)"&\`+%

W)#+%17=06+P+)7

E\)#"o-)"&\`+%

(+o.2"&-)"&\`+%

=06+V3#.1.`+%

=06+P+)7

,0$%2+3%0*%"1

#"%*+#3%0*%"1

"))0#"#+6 .)#+%17%+37

.)#+%17%+37

#05+),#%+"1

,\)#"o#%++ ,\)#"o

#%++

E\1L0&'f"L&+

0) "#$"%&

Page 25: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

=013.&+%'=0130)+)#'P+)+%"#0%,

E\)#"o-)"&\`+%

(+o.2"&-)"&\`+%

#05+),#%+"1

,\)#"o#%++

(+o.2"&-)"&\`+%P+)+%"#0%]&+o^

E\)#"o-)"&\`+%P+)+%"#0%]\"22^

&+o,3+2./.2"#.0)

\"22,3+2./.2"#.0)

,0$%2+3%0*%"1

0* "#$"%&

Page 26: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

(+o E3+2./.2"#.0)'/0%'"'_+,5'="&2$&"#0%

number [0-9]+\.?|[0-9]*\.[0-9]+

%%

[ ] { /* skip blanks */ }

{number} { sscanf(yytext, "%lf", &yylval);

return NUMBER; }

\n|. { return yytext[0]; }

0+ "#$"%&

Page 27: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

q"22 E3+2./.2"#.0)'/0%'"'_+,5'="&2$&"#0%

%token NUMBER%left '+'%left '*'%%lines : lines expr '\n' { printf("%g\n", $2); }

| /* empty */;

expr : expr '+' expr { $$ = $1 + $3; }| expr '*' expr { $$ = $1 * $3; }| '(' expr ')' { $$ = $2; }| NUMBER;

%%#include "lex.yy.c"

0, "#$"%&

Page 28: 0+anoopsarkar.github.io/.../Aho-SSST-Talk-Clipped.pdfG++%j -9Y {for(i = 99; i >= 0; i--) {the" lbottle(i wall." print}} {sprintf("%s bottle%s o m ore", n - 1 ? "s" : "")} {sprintf("%s

=%+"#.)*'#4+'_+,5'="&2$&"#0%

W)R05+'#4+'2011")6,lex desk.lyacc desk.ycc y.tab.c –ly –ll

J+,$&#

_+,5="&2$&"#0%>7@'p']F7K'b'B7M^ >A7D

0- "#$"%&