亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? tutor12.doc

?? 計(jì)算機(jī)編譯原理教材
?? DOC
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
O
PA2A



























                            LET'S BUILD A COMPILER!

                                       By

                            Jack W. Crenshaw, Ph.D.

                                  5 June 1989


                              Part XII: MISCELLANY





























PA2A





       *****************************************************************
       *                                                               *
       *                        COPYRIGHT NOTICE                       *
       *                                                               *
       *   Copyright (C) 1989 Jack W. Crenshaw. All rights reserved.   *
       *                                                               *
       *****************************************************************


       INTRODUCTION

       This installment is another one  of  those  excursions  into side
       alleys  that  don't  seem to fit  into  the  mainstream  of  this
       tutorial  series.    As I mentioned last time, it was while I was
       writing this installment that I realized some changes  had  to be
       made  to  the  compiler structure.  So I had to digress from this
       digression long enough to develop the new structure  and  show it
       to you.

       Now that that's behind us, I can tell you what I  set  out  to in
       the first place.  This shouldn't  take  long, and then we can get
       back into the mainstream.

       Several people have asked  me  about  things that other languages
       provide, but so far I haven't addressed in this series.   The two
       biggies are semicolons and  comments.    Perhaps  you've wondered
       about them, too, and  wondered  how things would change if we had
       to  deal with them.  Just so you can proceed with what's to come,
       without being  bothered by that nagging feeling that something is
       missing, we'll address such issues here.


       SEMICOLONS

       Ever since the introduction of Algol, semicolons have been a part
       of  almost every modern language.  We've all  used  them  to  the
       point that they are taken for  granted.   Yet I suspect that more
       compilation errors have  occurred  due  to  misplaced  or missing
       semicolons  than  any  other single cause.  And if we had a penny
       for  every  extra  keystroke programmers have used  to  type  the
       little rascals, we could pay off the national debt.

       Having  been  brought  up with FORTRAN, it took me a long time to
       get used to using semicolons, and to tell the  truth  I've  never
       quite understood why they  were  necessary.    Since I program in
       Pascal, and since the use of semicolons in Pascal is particularly
       tricky,  that one little character is still  by  far  my  biggest
       source of errors.

       When  I  began  developing  KISS,  I resolved to  question  EVERY
       construct in other languages, and to try to avoid the most common
       problems that occur with them.  That puts the semicolon very high
       on my hit list.A62A6
                                     - 2 -A*2A*

PA2A





       To  understand  the  role of the semicolon, you have to look at a
       little history.

       Early programming languages were line-oriented.  In  FORTRAN, for
       example, various parts  of  the statement had specific columns or
       fields that they had to appear in.  Since  some  statements  were
       too  long for one line, the  "continuation  card"  mechanism  was
       provided to let  the  compiler  know  that a given card was still
       part of the previous  line.   The mechanism survives to this day,
       even though punched cards are now things of the distant past.

       When  other  languages  came  along,  they  also  adopted various
       mechanisms for dealing with multiple-line statements.  BASIC is a
       good  example.  It's important to  recognize,  though,  that  the
       FORTRAN  mechanism  was   not   so  much  required  by  the  line
       orientation of that  language,  as by the column-orientation.  In
       those versions of FORTRAN  where  free-form  input  is permitted,
       it's no longer needed.

       When the fathers  of  Algol introduced that language, they wanted
       to get away  from  line-oriented programs like FORTRAN and BASIC,
       and allow for free-form input.   This included the possibility of
       stringing multiple statements on a single line, as in


            a=b; c=d; e=e+1;


       In cases like this,  the  semicolon is almost REQUIRED.  The same
       line, without the semicolons, just looks "funny":


            a=b c= d e=e+1

       I suspect that this is the major ... perhaps ONLY ...  reason for
       semicolons: to keep programs from looking funny.

       But  the  idea  of stringing multiple statements  together  on  a
       single  line  is  a  dubious  one  at  best.  It's not very  good
       programming  style,  and  harks back to  the  days  when  it  was
       considered improtant to conserve cards.  In these  days  of CRT's
       and indented code, the clarity of programs is  far  better served
       by  keeping statements separate.  It's still  nice  to  have  the
       OPTION  of  multiple  statements,  but  it seems a shame to  keep
       programmers  in  slavery  to the semicolon, just to keep that one
       rare case from "looking funny."

       When I started in with KISS, I tried  to  keep  an  open mind.  I
       decided that I would use  semicolons when it became necessary for
       the parser, but not until then.  I figured this would happen just
       about  the time I added the ability  to  spread  statements  over
       multiple lines.  But, as you  can  see, that never happened.  The
       TINY compiler is perfectly  happy  to  parse the most complicated
       statement, spread over any number of lines, without semicolons.A*2A*
                                     - 3 -

PA2A





       Still, there are people  who  have  used  semicolons for so long,
       they feel naked  without them.  I'm one of them.  Once I had KISS
       defined sufficiently well, I began to write a few sample programs
       in the language.    I  discovered,  somewhat to my horror, that I
       kept  putting  semicolons  in anyway.   So  now  I'm  facing  the
       prospect of a NEW  rash  of  compiler  errors, caused by UNWANTED
       semicolons.  Phooey!

       Perhaps more to the point, there are readers out  there  who  are
       designing their own languages, which may  include  semicolons, or
       who  want to use the techniques of  these  tutorials  to  compile
       conventional languages like  C.    In  either case, we need to be
       able to deal with semicolons.


       SYNTACTIC SUGAR

       This whole discussion brings  up  the  issue of "syntactic sugar"
       ... constructs that are added to a language, not because they are
       needed, but because they help make the programs look right to the
       programmer.    After  all, it's nice  to  have  a  small,  simple
       compiler,    but  it  would  be  of  little  use if the resulting
       language  were  cryptic  and hard to program.  The language FORTH
       comes  to mind (a premature OUCH! for the  barrage  I  know  that
       one's going to fetch me).  If we can add features to the language
       that  make the programs easier to read  and  understand,  and  if
       those features  help keep the programmer from making errors, then
       we should do so.    Particularly if the constructs don't add much
       to the complexity of the language or its compiler.

       The  semicolon  could  be considered an example,  but  there  are
       plenty of others, such as the 'THEN' in a IF-statement,  the 'DO'
       in a WHILE-statement,  and  even the 'PROGRAM' statement, which I
       came within a gnat's eyelash of leaving out  of  TINY.    None of
       these tokens  add  much  to  the  syntax  of the language ... the
       compiler can figure out  what's  going on without them.  But some
       folks feel that they  DO  add to the readability of programs, and
       that can be very important.

       There are two schools of thought on this subject, which  are well
       represented by two of our most popular languages, C and Pascal.

       To  the minimalists, all such sugar should be  left  out.    They
       argue that it clutters up the language and adds to the  number of
       keystrokes  programmers  must type.   Perhaps  more  importantly,
       every extra token or keyword represents a trap laying in wait for
       the inattentive programmer.  If you leave out  a  token, misplace
       it, or misspell it, the compiler  will  get you.  So these people
       argue that the best approach is to get rid of such things.  These
       folks tend to like C, which has a minimum of unnecessary keywords
       and punctuation.

       Those from the other school tend to like Pascal.  They argue that
       having to type a few extra characters is a small price to pay forA*2A*
                                     - 4 -

PA2A





       legibility.    After  all, humans have to read the programs, too.
       Their best argument is that each such construct is an opportunity
       to tell the compiler that you really mean for it  to  do what you
       said to.  The sugary tokens serve as useful landmarks to help you
       find your way.

       The differences are well represented by the two  languages.   The
       most oft-heard complaint about  C  is  that  it is too forgiving.
       When you make a mistake in C, the  erroneous  code  is  too often
       another  legal  C  construct.    So  the  compiler  just  happily
       continues to compile, and  leaves  you  to  find the error during
       debug.    I guess that's why debuggers  are  so  popular  with  C
       programmers.

       On the  other  hand,  if  a  Pascal  program compiles, you can be
       pretty  sure that the program will do what you told it.  If there
       is an error at run time, it's probably a design error.

       The  best  example  of  useful  sugar  is  the semicolon  itself.
       Consider the code fragment:


            a=1+(2*b+c)   b...


       Since there is no operator connecting the token 'b' with the rest
       of the  statement, the compiler will conclude that the expression
       ends  with  the  ')', and the 'b'  is  the  beginning  of  a  new
       statement.    But  suppose  I  have simply left out the  intended
       operator, and I really want to say:


            a=1+(2*b+c)*b...


       In  this  case  the compiler will get an error, all right, but it
       won't be very meaningful  since  it will be expecting an '=' sign
       after the 'b' that really shouldn't be there.

       If, on the other hand, I include a semicolon after the  'b', THEN
       there  can  be no doubt where I  intend  the  statement  to  end.
       Syntactic  sugar,  then,  can  serve  a  very  useful purpose  by
       providing some additional insurance that we remain on track.

       I find  myself  somewhere  in  the middle of all this.  I tend to
       favor the Pascal-ers' view ... I'd much rather find  my  bugs  at
       compile time rather than run time.  But I also hate to just throw
       verbosity  in  for  no apparent reason, as in COBOL.  So far I've
       consistently left most of the Pascal sugar out of KISS/TINY.  But
       I certainly have no strong feelings either way, and  I  also  can
       see the value of sprinkling a little sugar around  just  for  the
       extra  insurance  that  it  brings.    If  you like  this  latter
       approach, things like that are easy to add.  Just  remember that,A62A6
                                     - 5 -A*2A*

PA2A

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产岛国毛片在线| 国产一区二区影院| 久久久影视传媒| 日韩电影免费在线| 国产精品久久久久久久久免费相片 | 精品制服美女丁香| 天天操天天干天天综合网| 亚洲精品国产无套在线观| 亚洲视频网在线直播| 综合激情成人伊人| 综合久久久久久久| 亚洲国产精品久久人人爱| 一区二区高清在线| 午夜久久福利影院| 久久精品噜噜噜成人88aⅴ | 欧美mv日韩mv国产| 欧美一区午夜精品| 精品粉嫩超白一线天av| 国产三级精品三级在线专区| 亚洲视频一二区| 一区二区三区中文字幕| 午夜精品久久久久影视| 奇米888四色在线精品| 国产一区二区精品久久99| 成人动漫一区二区在线| eeuss鲁片一区二区三区| 91极品视觉盛宴| 欧美成人精品二区三区99精品| 久久这里只有精品6| ●精品国产综合乱码久久久久| 亚洲综合视频在线观看| 麻豆精品一二三| youjizz国产精品| 精品视频资源站| 久久精品在这里| 亚洲午夜免费福利视频| 韩国三级电影一区二区| av男人天堂一区| 欧美videos大乳护士334| 1024国产精品| 韩国精品一区二区| 一本大道久久a久久精品综合| 欧美一卡在线观看| 中文字幕一区二区三区在线播放| 视频一区国产视频| 国v精品久久久网| 欧美日韩国产综合视频在线观看| 久久综合色鬼综合色| 一区二区三区成人| 国产一区二区三区电影在线观看 | 欧美二区乱c少妇| 欧美韩国日本综合| 欧美va亚洲va| 首页欧美精品中文字幕| 99久久综合狠狠综合久久| 欧美一区二区三区思思人| 国产精品国产三级国产aⅴ原创| 亚洲成在人线免费| www.亚洲色图| 日本一区二区三区国色天香| 麻豆精品一二三| 欧美高清精品3d| 亚洲精品久久久蜜桃| 成人av资源在线| 国产蜜臀av在线一区二区三区| 免费在线观看成人| 欧美久久婷婷综合色| 亚洲日韩欧美一区二区在线| 成人免费看黄yyy456| 精品88久久久久88久久久| 日韩av成人高清| 51精品国自产在线| 亚洲国产中文字幕| 91黄视频在线观看| 一区二区三区在线看| 91一区二区在线观看| 国产精品乱码一区二区三区软件| 国产资源在线一区| 日韩三区在线观看| 久久www免费人成看片高清| 欧美日韩大陆一区二区| 一级日本不卡的影视| 一本大道综合伊人精品热热| 亚洲日本一区二区| 99九九99九九九视频精品| 亚洲一区二区中文在线| 99re在线精品| 亚洲欧美电影院| 91激情在线视频| 日本一不卡视频| 久久精品欧美一区二区三区不卡| 国产成人精品影视| √…a在线天堂一区| 91福利小视频| 日本女人一区二区三区| 91精品国产欧美一区二区成人| 免费黄网站欧美| 国产欧美日产一区| 在线中文字幕一区| 美腿丝袜一区二区三区| 久久久久久久电影| 91热门视频在线观看| 亚洲成人在线免费| 精品久久久久久综合日本欧美| 大白屁股一区二区视频| 亚洲在线免费播放| 日韩亚洲欧美综合| 丁香啪啪综合成人亚洲小说| 午夜国产精品影院在线观看| 久久蜜桃av一区精品变态类天堂| 99这里都是精品| 日本视频免费一区| 亚洲国产精品精华液2区45| 欧美专区日韩专区| 精品综合久久久久久8888| 亚洲欧美日韩国产一区二区三区 | 不卡一区中文字幕| 天天色综合天天| 国产精品初高中害羞小美女文| 欧美视频在线一区二区三区| 国产综合色精品一区二区三区| 亚洲成人动漫av| 国产精品福利在线播放| 欧美一区二区三区小说| 丰满放荡岳乱妇91ww| 一区二区免费看| 久久久久久久久久久久电影| 欧美少妇性性性| 成a人片国产精品| 国产在线精品免费| 亚洲一区二区三区四区不卡| 国产欧美视频一区二区三区| 91精品国产91久久久久久一区二区 | 在线综合+亚洲+欧美中文字幕| www.欧美精品一二区| 韩国成人在线视频| 日韩一区精品视频| 亚洲午夜私人影院| 日韩理论片网站| 国产精品女同一区二区三区| 欧美哺乳videos| 欧美一级日韩免费不卡| 欧美系列一区二区| 99久久精品99国产精品| 成人午夜免费av| 丁香桃色午夜亚洲一区二区三区 | 欧美激情在线一区二区| 欧美videos中文字幕| 欧美高清一级片在线| 欧洲国内综合视频| 色婷婷综合视频在线观看| 成人午夜免费电影| 成人国产一区二区三区精品| 成人一级视频在线观看| 国产一区在线精品| 国产伦精品一区二区三区视频青涩| 久国产精品韩国三级视频| 美女任你摸久久| 国产一区999| 国产成人鲁色资源国产91色综| 国产精品综合av一区二区国产馆| 久久精品国产在热久久| 久久国产精品99久久人人澡| 日韩avvvv在线播放| 香蕉影视欧美成人| 天堂资源在线中文精品| 亚洲成av人片观看| 日韩av一区二区在线影视| 久久精品72免费观看| 国产精品综合二区| jizz一区二区| 欧美日韩一区二区三区免费看| 8v天堂国产在线一区二区| 欧美一区二区成人6969| 久久久亚洲午夜电影| 国产精品剧情在线亚洲| 一区二区三区波多野结衣在线观看| 亚洲不卡av一区二区三区| 日韩电影在线免费看| 国产一区二区三区四| 99精品1区2区| 91精品国产高清一区二区三区| 久久久久国产精品免费免费搜索| 中文字幕中文字幕在线一区 | 久久se这里有精品| 国产成人免费av在线| 91一区二区在线观看| 欧美日韩1区2区| 国产丝袜在线精品| 亚洲综合在线第一页| 久久精品国产精品亚洲精品| 不卡视频一二三四| 欧美乱熟臀69xxxxxx| 亚洲国产精品激情在线观看| 首页综合国产亚洲丝袜| 高清国产一区二区三区| 欧美日韩另类国产亚洲欧美一级| 久久这里都是精品| 亚洲福利国产精品| 懂色av一区二区夜夜嗨|