ãã®èšäºã§ã¯ã倧èŠæš¡ãªãœãããŠã§ã¢ããã³æ
å ±ã·ã¹ãã ã®éçºçšã«èšèšãããç¹å®ã®ãœãããŠã§ã¢è£œåã«çŠç¹ãåœãŠãŸãã ãã®è£œåã¯ãProject GeneratorããšåŒã°ãããœãããŠã§ã¢ã·ã¹ãã ã®éçºããã»ã¹ãèªååã®å¯Ÿè±¡ãšèŠãªãããå Žåãããã°ã©ãã³ã°ãžã®æ段çã¢ãããŒãã«åºã¥ããŠããŸãã ãã®ãããã¯ã¯ãåäžçŽã®70ã80幎代ã®ã©ããã§ããªãæµè¡ããŠããŸããããç§ãã¡ã®æèŠã§ã¯ããã®ã¢ãããŒãã¯ä»æ¥ã§ã¯æ代é
ãã§ã¯ãããŸããã å°ãªããšããç§ãã¡ã®ã¯ãªãšã€ãã£ãããŒã ã¯ãé·å¹Žã«ããã£ãŠ
ãç¬èªã®ããŒã«ã䜿çšã
ãŠããŸããŸãªç®çã§ç£æ¥çšèªåã·ã¹ãã ãéçºããããšãã§ããŸããã
èšäºã®ä»¥äžã®ã»ã¯ã·ã§ã³ã§ã¯ããã®åé¡ã«å¯Ÿããç§ãã¡èªèº«ã®èŠè§£ã®æŽå²ççºå±ãèæ
®ã«å
¥ããŠã倧èŠæš¡ãªãœãããŠã§ã¢ããã³æ
å ±ã·ã¹ãã ã®éçºã«å¯Ÿããæ段ãµããŒããžã®ã¢ãããŒãã®ããã€ãã®æè¡çåŽé¢ãæ€èšããŸãã ç§ãã¡ã®ãèªå·±æãèµ·ããããé床ã«å€åã ãšæããèŠèŽè
ã®éšåã«ã€ããŠã¯ããçŸåšã®ç¶æ³ãã»ã¯ã·ã§ã³ã«çŽæ¥è¡ãããšãææ¡ããŸãã
éçºè
ã®åæ©ãç解ããããã®æŽå²çãªé 足
ãããžã§ã¯ããžã§ãã¬ãŒã¿ãŒã¯ãããç¥ãããçç±ã«ãããèªç©ºèšèšå±ã§ãããžã§ã¯ãã®äœæ¥ãå®äºããä»ã®åéã§ç²åŸããçµéšã®å¿çšã暡玢ãå§ããããã«éçºããŒã ã匷å¶ãããååäžçŽä»¥äžåã«æ·èšãããŸããã
éè¡ã»ã¯ã¿ãŒã®ããã€ãã®ãããžã§ã¯ãã«åãçµãã§ãããšããã©ã¡ãŒã¿ãŒã®æ§æã®ã¿ãç°ãªãå€ãã®é¡äŒŒããèŠçŽ ã§æ§æãããããã€ãã®ã·ã¹ãã ãäœæããå¿
èŠããããŸããã éçºäžã®ã·ã¹ãã ã¯ãã¯ãŒã¯ã¹ããŒã·ã§ã³-ãµãŒããŒ-ããŒã¿ããŒã¹ãšãã2ã¬ãã«ã®ã¯ã©ã€ã¢ã³ããµãŒããŒãšããåœæã®æ°ããæè¡ã«åºã¥ããŠæ§ç¯ãããŸããã äžè¬ã«ãã¯ã©ã€ã¢ã³ãã¯ãŒã¯ã¹ããŒã·ã§ã³ã®ã·ã¹ãã ã®åèŠçŽ ã¯ãç¹å®ã®ã¢ã¯ã·ã§ã³ãå®è¡ããå Žåã«ãã£ãŠã¯å¥ã®ç»é¢ã«åãæ¿ããããã«ãããŒã¿å
¥åãã©ãŒã ãè€æ°ã®ããŒãã«ãè€æ°ã®ãã¿ã³ãŸãã¯ã¡ãã¥ãŒé
ç®ãåããç»é¢ãå®è£
ããŸããã ã¯ã©ã€ã¢ã³ã/ãµãŒããŒãããã³ã«ã§ã¯ã察å¿ããããŒã¿ã®éä¿¡ãšãµãŒããŒå¿çã®åä¿¡ãããã°ã©ã ããå¿
èŠããããŸããã ãµãŒããŒã¯ãã¯ãšãªãã©ã¡ãŒã¿ã®ååŸãåæãããŒã¿ããŒã¹ãžã®å¿
èŠãªã¯ãšãªã®å®è¡ãçµæãã¯ã©ã€ã¢ã³ãã®ãªã¯ãšã¹ããžã®å¿çã®åœ¢åŒã§éä¿¡ããæé ãæäŸããŸããã
ãããã£ãŠãäœæ¥ã¯2次å
ã®ããã«å®è¡ãããŸããã ãããã®1ã€ã¯ãæ°ãããã©ã°ã¡ã³ãã®éçºã§ããããããããã·ãŒãžã£ãšåŒã³ãŸãã éçºäžããã³åé¡ã®æ¹è¯äžã«æ°ããæé ãç»å ŽããŸããã å€ãæé ãå€æŽãããŸããã
ããã§ããæé ããšããèšèã¯ãããšãã°ãã¹ã«ã«ã®æå³ã§ã¯äœ¿çšãããŸããã ãµãã«ãŒãã³ãé¢æ°ãªã©ã®ãããªãã®ã§ããããããäžçš®ã®ããã°ã©ã ã³ãŒããã³ãã¬ãŒãã§ãã
2çªç®ã®æ¬¡å
ã¯ãæé ãå®è£
ããããã®æè¡ãã®ãã®ã§ãã ãããã³ã«ãå€æŽãããããŸããŸãªã»ãã¥ãªãã£ãµãã·ã¹ãã ãæ¥ç¶ããããããã¯ã©ã€ã¢ã³ãããã°ã©ã ãšãµãŒããŒããã°ã©ã ã®äž¡æ¹ã§ã以åã«å®è£
ããããã¹ãŠã®æé ã®ããã°ã©ã ã³ãŒããäžåºŠã«å€æŽããå¿
èŠãçããŸããã
ããã«ãå€æ°ã®æé ã䜿çšããŠãã¯ã©ã€ã¢ã³ããšãµãŒããŒã®ããã°ã©ã ãçžäºäœçšã®ãããã³ã«ã«æºæ ããŠãããšããç¹ã§ãããžã§ã¯ãã®æŽåæ§ãç¶æããããšãåé¡ã«ãªããŸããã ããšãã°ãæ°ãããã©ã¡ãŒã¿ãäœããã®ãªã¯ãšã¹ãã§è¿œå ãããå Žåã察å¿ããç·šéã¯ãã¯ã©ã€ã¢ã³ããšãµãŒããŒã®2ã€ã®ç°ãªãããã°ã©ã ã§äžè²«ããŠå®è¡ããå¿
èŠããããŸãã
äžèšã«é¢é£ããŠããã®ããã»ã¹ãèªååããã¢ã€ãã¢ãçãŸããŸããã ãã®é ãŸã§ã«ã¯ãè€éãªèšèªã®æ§æ解æããã°ã©ã ïŒä»£æ°ã¢ãã«ãåæåŒã®èšç®ããã®ä»ã®ç¡é¢ä¿ãªã¿ã¹ã¯ã®éå±€çèšè¿°ãå«ãFakiræŠå¿µããã°ã©ãã³ã°ã·ã¹ãã ïŒã®å®è£
ã®çµéšããããŸããã
ãã®çµæãããŸããŸãªãããžã§ã¯ããã©ã¡ãŒã¿ãšäžé£ã®æé èšè¿°ãå«ãèŠåºãã§æ§æããããããžã§ã¯ãèšè¿°èšèªãéçºãããŸããã åããã·ãŒãžã£ã«ã¯ãäžæã®ååãå
¥åãã©ã¡ãŒã¿ã®ãªã¹ããå
¥åãã©ã¡ãŒã¿ãšåºåãã©ã¡ãŒã¿ã®æå®ãå«ããµãŒããŒãžã®ãªã¯ãšã¹ãã®ãªã¹ããããã³å¿çã®ã¿ã€ãïŒè¡šãŸãã¯1ã»ããïŒãããã³ãã®ããã·ãŒãžã£ã®ã³ã³ããã¹ãã§å®è¡ã§ããæäŸãããã¢ã¯ã·ã§ã³ã®ãªã¹ãããããŸããã
ããã·ãŒãžã£ã§äœ¿çšãããååä»ãããŒã¿åã¯ããã®èª¬æã§ãããžã§ã¯ãã®äžéšãšããŠæå®ãããŸããã 説æã¯ãæ§æã®ããŸããŸãªã³ã³ããŒãã³ããšã¿ã€ãã®å¯Ÿå¿ã«ã€ããŠèªç¶ã«å¶åŸ¡ãããŠããŸããã
ãã®ãããªèšè¿°ã¯ããããžã§ã¯ããžã§ãã¬ãŒã¿ãŒã®å
¥åã«éä¿¡ããããããžã§ã¯ããžã§ãã¬ãŒã¿ãŒã¯ã¡ã¢ãªå
ã«ãããžã§ã¯ãã¢ãã«ãæ§ç¯ããæŽåæ§ã®åæãè¡ããŸããã ããã«ãã¢ãã«ã«åºã¥ããŠãã¯ã©ã€ã¢ã³ãããã³ãµãŒããŒããã°ã©ã ã¢ãžã¥ãŒã«ãå®è£
ããããã°ã©ã ã®ããã¹ããçæãããŸããã
æãåçŽãªå Žåã®ã¯ã©ã€ã¢ã³ãããã°ã©ã ã¯å®æãã圢åŒã§çæãããŸããããç¹æ®ãªå Žåã«ã¯ã説æããåçŽãªãããžã§ã¯ãã¢ãã«ã§æäŸãããŠããªãç¹å¥ãªã¢ã¯ã·ã§ã³ãå®è¡ããæåãœãããŠã§ã¢æ¿å
¥ã泚æããããšãã§ããŸããã
ãããžã§ã¯ãããã°ã©ã èªäœã¯Cèšèªã§å®è£
ãããŸããã åœæã®ãµãŒããŒã¯VAX VMSãã©ãããã©ãŒã äžã«ãããMS DOSãå®è¡ããŠããIBM PCäžã®ã¯ã©ã€ã¢ã³ãããã°ã©ã ã§ããïŒVAX VMSã§ãæäŸãããŠããŸããïŒã ãµãŒããŒèŠæ±ã¯Cäžã®ããªããã»ããµã§æžã蟌ãŸããCããã°ã©ã ã®ããã¹ãã«åã蟌ãŸããSQLã¯ãšãªãç解ããŸããã
ãããžã§ã¯ãã®èª¬æã«ã¯ã説æããã¿ã€ãã«é¢ããããŒã¿ããŒã¹ããŒãã«ã®èª¬æãå«ãŸããŠããŸããã ããã«ãããç¹å®ã®ããŒã¿ããŒã¹ã¹ããŒãã«æºæ ããããã®å®å
šãªè§£æã䜿çšããŠãSQLèšèªã®ãµãã»ããã®ãããžã§ã¯ãã®èª¬æã§ããŒã¿ããŒã¹ãžã®åçŽåãããã¯ãšãªãäœæã§ããŸããã ããè€éãªã¯ãšãªã¯ãããªããã»ããµããŒã«ã䜿çšããŠãµãŒããŒããã°ã©ã ã«å®è£
ãããŸããã
説æãããæè¡ãæ ¹ä»ããŠããã10幎éã«ããã£ãŠæã®è©Šç·Žã«èããŠããŸããã ãã®å©ãã«ãããããŸããŸãªåéã§ããªãã®æ°ã®ãããžã§ã¯ããè¡ãããŸããã
ãããžã§ã¯ãã¢ãã«ãæ¹åãããè€éã«ãªããŸããã ãœãããŠã§ã¢ããã³ããŒããŠã§ã¢ãã©ãããã©ãŒã ã¯å€åããŠããŸããã ã¯ã©ã€ã¢ã³ãããã³ãµãŒããŒã¯ãMS Windowsããã³Linuxã§æ©èœãå§ããŸããã
äžèšã®2次å
ã®éçºã«ãããã¢ããªã¹ãã®ä»äºãšã·ã¹ãã ããã°ã©ãã®ä»äºãåé¢ããããšãã§ããŸããã ã¢ããªã¹ãã¯é©çšãããã¿ã¹ã¯ã«çŠç¹ãåããããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ããããã³ã«ãèšèªãªã©ã®ã·ã¹ãã ããã°ã©ããŒã«çŠç¹ãåœãŠãŸããã
ãã®ãã¯ãããžãŒã®äž»ãªå©ç¹ã¯ãã·ã¹ãã éçºè
ãäœæããã³ãŒãã倧å¹
ã«åæžãããããšã§ãã 1ã€ã®æé ã®èšè¿°ã«ã¯æ°åè¡ãããå ŽåããããéåžžãçæãããCããã°ã©ã ã³ãŒãã¯1æ¡å€§ãããªããŸãã ã·ã¹ãã ãœãããŠã§ã¢ãå€æŽããŠããã¢ããªã±ãŒã·ã§ã³éçºè
ã®ã³ââãŒãã«ã¯åœ±é¿ããŸããããã®ãããªå€æŽã¯ããžã§ãã¬ãŒã¿ã®æ°ããããŒãžã§ã³ã§èæ
®ãããŸãã
ãããžã§ã¯ããžã§ãã¬ãŒã¿ãŒã䜿çšãããšãæå°éã®éçºè
ïŒå€ãã®å Žå1人ïŒã§è€éãªããªã¥ãŒã ãããžã§ã¯ããå®è£
ã§ããŸãããããã¯ãããã°ã©ãã³ã°ã®è€éãã«ç²ŸéããŠããªãã£ãããã·ã¹ãã éçºã®æ°åŠçãã¬ãŒãã³ã°ãšçµéšããã人ã
ã«ãã£ãŠè¡ãããŸããã ã€ãŸã ããã°ã©ããŒã§ã¯ãªããã¢ããªã¹ããç¬ç«ããŠè€éãªãããžã§ã¯ããäœæããã·ã¹ãã ããã°ã©ããŒãé¢äžãããããšãªãäœæ¥ç¶æ
ã«ããããšãã§ããŸããã
éçºã®å©äŸ¿æ§ã確ä¿ããããã«ããããžã§ã¯ããèšèšããããã®ããŸããŸãªè£å©æ©èœããžã§ãã¬ãŒã¿ã§çµ¶ããæ¹åãããŸããã ããã°ã©ã ããã¹ãã«å ããŠãããŸããŸãªãã©ãããã©ãŒã ã®ãã¹ãŠã®ããã°ã©ã ã³ã³ããŒãã³ãã®ç¿»èš³ãšã¢ã»ã³ããªãå®è¡ããããã«ãå€æ°ã®ããããã¡ã€ã«ãçæãããŸããã çæãããããŒã¿ããŒã¹äœæããã³å€æŽãŠãŒãã£ãªãã£ã 顧客ã«è»¢éããããã®ã€ã³ã¹ããŒã«ããã±ãŒãžãäœæããæé ã¯èªååãããŸããã
ããããªçšèªã®æ··ä¹±ã«æ³šæããŠãã ããã äžèšã®ãããžã§ã¯ãèšè¿°èšèªã¯ãCãPascalãªã©ã®ããã«ããã°ã©ã æŒç®åãååšããªããšããæå³ã§ãéæç¶ãåèšèªãšããŠæå®ãããããšããããããŸããããããžã§ã¯ãèšèªã§èšåãããŠããæé ã¯ããŸã£ããç°ãªãæŠå¿µã§ãã
éæç¶ãåãããžã§ã¯ãã¢ãã«ãããŠãããŒãµã«ããã°ã©ãã³ã°èšèªãžã®ç§»è¡
2000幎代åé ã®é£äžã«é£æ¬²ãå¢ãã«ã€ããŠããããžã§ã¯ããããã«çºå±ãããããã«äœ¿çšãããæè¡ãæ¹åããå¿
èŠããããšããç解ããããŸããã
ãŸãããããžã§ã¯ãã¢ãã«èªäœã®ãã¬ãŒã ã¯ãŒã¯ããäžé£ã®åãããŒã¿ããŒã¹ãäžé£ã®ã¯ãšãªããã·ãŒãžã£ãšããŠãã¿ã€ãã«ãªããŸããã
第äºã«ããµãŒããŒããã°ã©ã ã§ãæã«ã¯ã¯ã©ã€ã¢ã³ãããã°ã©ã ã§Cèšèªã䜿çšããã®ã¯é¢åã«ãªããŸããã ã¢ããªã¹ãã®ã¬ãã«ãäœããããšããã©ã¡ãŒã¿ãŒããã€ã³ã¿ãŒããŒããã€ããªã©ãæž¡ãããšã®è©³çŽ°ãšåŸ®åŠããæãäžããããšã§ãã
äžæ¹ãéè¡äŒèšã®ããŒãºã®ããã«ããŒã¿ããŒã¹ãžã®åçŽãªã¯ãšãªã§ã¯ãªããè€éãªããŒã¿æ§é ãæã€èšå€§ãªããã°ã©ã ãæžãå¿
èŠããããããžã§ã¯ããç»å ŽããŸããã ãã®ãããªãããžã§ã¯ãã§ã¯ãå€ãã®æåã³ãŒããäœæããå¿
èŠããããããããã°ã©ã ããã¹ãã®èªåçæã®å¹æãäœäžããŸããã
ãŠã£ã³ããŠã€ã³ã¿ãŒãã§ã€ã¹ãžã®ç§»è¡ã«äŒŽããæ©äŒãçãŸããŸããããã®çµæãã¯ã©ã€ã¢ã³ãããã°ã©ã ã§ãããã¹ããšæ°åãå«ãããŒãã«ã ãã§ãªããåçãå³é¢ãªã©ã®ããããçš®é¡ã®ã³ã³ãã³ãã衚瀺ããå¿
èŠããããŸããã
ãã®ç¹ã§ãã¯ã©ã€ã¢ã³ã/ãµãŒããŒçžäºäœçšãããã³ã«ãè€éã«ããå¿
èŠããããŸããã ããã¯ãã¹ãŠããŸã£ããæ°ãããããžã§ã¯ããžã§ãã¬ãŒã¿ãŒãéçºããã€ã³ã»ã³ãã£ãã«ãªããŸããã
æ°ããéçºã¯ãæ§é ææžã®æŠå¿µã«åºã¥ããŠããŸããã ãããžã§ã¯ããžã§ãã¬ãŒã¿ãŒã®ã³ã³ããã¹ãã§ã®ããã¥ã¡ã³ãã¯ãäžå¿æŠå¿µã®1ã€ãå ããŸãã äŒè©±ã¬ãã«ã§ã¯ãããã¥ã¡ã³ãã¯ããã°ã©ã ã¡ã¢ãªå
ã®ãããã¯ãŒã¯æ§é ã®ããŒã¿ããŒã¹ã§ãã
ææžïŒããŒã¿ããŒã¹ïŒã®ãããã¯ãŒã¯æ§é ã¯ã1察å€ã®é¢ä¿ã確ç«ãããŠããè¡ã®éã§ãããŒãã«ããã®äžã«æ ŒçŽãããŠããããšãåæãšããŠããŸãã ããã¯ãé·å¹Žã®èšèšã§äœ¿çšããŠãããããã¯ãŒã¯æ§é ããŒã¿ããŒã¹ã®å€ããå¿ããããæŠå¿µã§ãã
äž»ãªã¢ã€ãã¢ã¯ãã¯ã©ã€ã¢ã³ãããã°ã©ã ãè€æ°ã®ã¿ãã«ãããŒãã«ã®åœ¢åŒã§ã¯ãªãããã®ãªã¯ãšã¹ãæ§é çšã«ä¿®æ£ãããä»»æã®ããã¥ã¡ã³ãã®åœ¢åŒã§ãµãŒããŒããæ
å ±ãåä¿¡ããããšã§ããã ãŸãã察称çã«ãã¯ã©ã€ã¢ã³ãã¯ãªã¯ãšã¹ããåŠçããäžè¬çãªåœ¢åŒã§ããã¥ã¡ã³ããéä¿¡ããŸãã
ãããã£ãŠããµãŒããŒã¯ãããã³ã«ããå
¥åããã¥ã¡ã³ããèªã¿åãããã®æ§é ãã¡ã¢ãªã«åŸ©å
ã§ããå¿
èŠããããŸãã ããã«ãåä¿¡ããããã¥ã¡ã³ãã«åºã¥ããŠãçŸåšã¯ããžãã¹ããžãã¯ãšåŒã°ããç¹å®ã®ããã°ã©ã ãå®è¡ããŸãããã®ããã°ã©ã ã§ã¯ãããŒã¿ããŒã¹ïŒã¡ã¢ãªå
ã§ã¯ãªããå®éã®ïŒãšã®å¯Ÿè©±ãæ³å®ãããŸãã ãã®çµæãããã°ã©ã ã¯ããããã³ã«ã«åŸã£ãŠã¯ã©ã€ã¢ã³ãããã°ã©ã ã«éä¿¡ããããã®åºåããã¥ã¡ã³ããçæããå¿
èŠããããŸãã
ã¯ã©ã€ã¢ã³ãããã°ã©ã ã¯ãåä¿¡ããããŒã¿ã«åºã¥ããŠã¢ããªã±ãŒã·ã§ã³ãŠã£ã³ããŠã®ã³ã³ãã³ããçæããããã°ã©ã ãæäŸããå¿
èŠããããŸãã
åæãããžã§ã¯ãã§ã¯ã以åã®ããŒãžã§ã³ã®ãžã§ãã¬ãŒã¿ãŒãšåæ§ã«ããµãŒããŒèŠæ±ã®æ¬æãèšè¿°ããããã®Cèšèªã®äœ¿çšãããã³ã¢ããªã±ãŒã·ã§ã³ãŠã£ã³ããŠã®ã³ã³ãã³ããäœæããããã®ããã°ã©ã ãæ³å®ããŠããŸããã å®éšããŒã«ãšããŠãæ¯èŒçç°¡åãªããã°ã©ãã³ã°èšèªãéçºãããCèšèªã眮ãæããããã«åçŽãªã±ãŒã¹ã§èšèšãããŸããã ãã®èšèªã¯ããããžã§ã¯ãå
šäœã®èšè¿°èšèªã®äžéšã§ããããžã§ãã¬ãŒã¿ãŒã®ããŒã¹èšèªã®åŸæ¥ã®ååãåãåããŸããã
åºæ¬èšèªã®åºæ¬æŠå¿µã以äžã«ãªã¹ãããŸãã
ååä»ãããŒã¿åã®èª¬æã¯ãæå®ã®åºå®é·ã®æååãç°ãªãæ¡æ°ãåæåããã¹ã¯åïŒååä»ãã³ã³ããŒãã³ããå«ãããããã¹ã¯ïŒãæ§é ããããŠæåŸã«äžèšã®ããã¥ã¡ã³ãã§ãã
ææžãå«ããæå®ãããã¿ã€ãã®ãã©ã¡ãŒã¿ãŒãæã€æé ïŒCã®é¢æ°ã®é¡äŒŒäœïŒã
äž»ãªæšæºæŒç®åã¯ã代å
¥ãæ¡ä»¶æŒç®åãforã«ãŒããwhileã«ãŒããããã·ãŒãžã£ã³ãŒã«ãåŒã§ãã ãã¹ãŠãéåžžã®æšæºèšèªã«éåžžã«äŒŒãŠããŸãã ããã¥ã¡ã³ãã¿ã€ãã®å Žåããã®ã³ã³ããŒãã³ããæäœããæé ãèªåçã«äœ¿çšå¯èœã«ãªããŸãã
çµæã¯å§åçã§ãã-çŸåšã®ãããžã§ã¯ãã§ãã°ããããŠãããCããã°ã©ã ã®ã·ã§ã¢ã¯æ¥éã«æžå°ããŠéèŠã§ãªããµã€ãºã«ãªããŸããã ã©ããããããããããžã§ã¯ãéçºè
ã¯ããããžã§ã¯ãã¢ãã«ã ãã§ãªããã¯ã©ã€ã¢ã³ããšãµãŒããŒã®äž¡æ¹ã®ãã¹ãŠã®ããã°ã©ã ããã®èšèªã®ã¿ã§èšè¿°ãå§ããããšãå€æããŸããã
ãã®äºæããªãããã»ã¹ã®ç¥æ Œåã¯ããžã§ãã¬ãŒã¿ãŒèªäœãåºæ¬èšèªã§èšè¿°ããããšã§ãã
éçºã®ããŸããŸãªæ®µéã§ã®ãããžã§ã¯ããžã§ãã¬ãŒã¿ãŒã¢ãŒããã¯ãã£
æåã¯ãå
¥åæã«ãããžã§ã¯ãã®èª¬æãCèšèªã®æåããã°ã©ã ã®ããã¹ãã®ã»ãããããã³Cçšã®ããŒã¿ããŒã¹ããªããã»ããµããžã§ãã¬ãŒã¿ãŒæ§é ãæ³å®ããŠããŸããã åºåã¯ã翻蚳ãã¢ã»ã³ãã«ãé
åžãããã³ãã®ä»ã®æçšãªã¢ã¯ã·ã§ã³ã®ããã®äžé£ã®Cããã°ã©ã ãšã¹ã¯ãªããã§ãã
éçºã®ãã®æ®µéã§ã®ãžã§ãã¬ãŒã¿ãŒæ§é ã¯ã次ã®å³ã®ãããªåœ¢åŒã§ããã
åºæ¬èšèªã®åºçŸã«ããããžã§ãã¬ãŒã¿ãŒã®æ§é ã¯æ¬¡ã®ããã«ãªããŸããã ãžã§ãã¬ãŒã¿ãŒã§ã¯ããããžã§ã¯ãã¢ãã«ã®Cã³ãŒããžã§ãã¬ãŒã¿ãŒãšããŒã¹èšèªã®ããã¹ãã®Cã³ãŒããžã§ãã¬ãŒã¿ãŒã®2ã€ã®ã³ã³ããŒãã³ããåºå¥ãããŸããã
ãããžã§ã¯ãã¢ãã«ã«ã¯ããµãŒããŒãã¢ããªã±ãŒã·ã§ã³ããµãŒããŒããŒããã»ãã¥ãªãã£ãµãã·ã¹ãã ãã¢ããªã±ãŒã·ã§ã³ãŠã£ã³ããŠã®çš®é¡ããã€ã¢ãã°ããã®ä»å€ãã®æçšãªãã®ãªã©ã®é«ã¬ãã«ã®ãšã³ãã£ãã£ãå«ãŸããŠããŸãã ãããžã§ã¯ããçæããããã»ã¹ã®ããããã¹ãŠã®ã¢ãã«ãšã³ãã£ãã£ã¯ãCããã°ã©ã ãçæããŸãã
éçºè
ã¯ãç¹å®ã®ã«ãŒã«ã«åŸã£ãŠããããžã§ã¯ãã®Cããã°ã©ã ã®çµæã»ããã«å«ãŸããCããã°ã©ã ãäœæããŸãã
ããã¥ã¢ã«Cããã°ã©ã ã®äžéšã¯ãããŒã¹èšèªã®åçã®ããã°ã©ã ã«çœ®ãæããããšãå¯èœã«ãªããŸãããããã¯ããããžã§ã¯ãã¢ãã«ãšããç°¡åã«çµ±åã§ããŸãã
ãããã£ãŠãåºæ¬èšèªã®åºçŸã«ããããžã§ãã¬ãŒã¿ãŒã®æ§é ã¯æ¬¡ã®å³ã«ç€ºã圢åŒã«ãªããŸããã
åºæ¬çãªèšèªãéçºããéçšã§ããã®äžã§ã®å
¥åããã¹ãã®éãå¢å ããCã§ã¯æžå°ããŸããã ãŸããã¢ãã«èšè¿°èšèªãéçºããããšãããŒã¹èšèªã®ã³ãŒãéãæžå°ããã¢ãã«ãšã³ãã£ãã£ã®çãèšè¿°ãšé·ãèšè¿°ã«çœ®ãæããããŸãã
ãããžã§ã¯ãèšè¿°ã®ã¢ãã«ã³ã³ããŒãã³ããè€éã§ãããããã¢ãã«ããCã³ãŒãã§ã¯ãªãããŒã¹èšèªã®ã³ãŒããçæãããšããã¢ã€ãã¢ãçãŸããŸããã ããã«ãããã¢ãã«ãšã³ãã£ãã£ã®å®è£
ã®ããã«Cã®è€éãªã¢ãã¬ã¹æå®ãç£èŠããå¿
èŠããªããªã£ãããããžã§ãã¬ãŒã¿ãŒèªäœãç°¡çŽ åãããŸããã Cã®ããŒã¹èšèªã®ç¿»èš³è
ã¯ãããããã¹ãŠãç£èŠããŸãã
ãã®çµæãçºé»æ©ã®æ§é ã¯æ¬¡ã®ããã«ãªããŸããã
ãžã§ãã¬ãŒã¿ãŒã®ããŒã¹èšèªã®åºæ¬æŠå¿µ
ããŒã¹èšèªã¯ãæ±çšããã°ã©ãã³ã°èšèªãå®è£
ãããããžã§ã¯ãèšè¿°ãžã§ãã¬ãŒã¿ãŒèšèªã®äžéšã§ãã ãããžã§ã¯ããžã§ãã¬ãŒã¿ã䜿çšããéçºè
ã¯ããããžã§ã¯ãã®äžéšãšããŠããã®èšèªã§éåžžã®ããã°ã©ã ãäœæã§ããŸãã
Cãšã¯ç°ãªããããŒã¹èšèªã§åå¥ã®ããã°ã©ã ãäœæããŠãããŒããã£ã¹ãããæ¹æ³ã¯ãããŸããã ããã°ã©ã ãæ°åã®ãªãã¬ãŒã¿ã§æ§æãããŠããå Žåã§ããããã°ã©ã ãå¯äžã®ã³ã³ããŒãã³ããšãªããããžã§ã¯ãããŠãŒãã£ãªãã£ã¿ã€ãã®ããã±ãŒãžïŒã³ã³ãœãŒã«ã¢ããªã±ãŒã·ã§ã³ïŒãšããŠèšè¿°ããå¿
èŠããããŸãã
ããè€éãªå ŽåãããŒã¹èšèªã®ããã°ã©ã ã¯ããã€ãã®ããã±ãŒãžã§æ§æãããŸãã
ããã±ãŒãžã¯ããžã§ãã¬ãŒã¿ãŒïŒããã³ããŒã¹ïŒèšèªã®åºæ¬æŠå¿µã®1ã€ã§ãã ããã±ãŒãžã¯ãããžã§ã¯ãå
ã§äžæã®ååãæã¡ãäœããã®ã¿ã€ãã®ããã±ãŒãžãšããŠå®£èšãããååãšããŠãããã±ãŒãžããã°ã©ã ããã¹ããå«ãå¥ã®ãã¡ã€ã«ãšããŠæ瀺ãããŸãã
ãããžã§ã¯ãèšè¿°ã¯ãããããŒãšããã±ãŒãžã®é åºä»ããªã¹ããå«ããããžã§ã¯ãèšè¿°ãã¡ã€ã«ã§ãã
ãžã§ãã¬ãŒã¿ãŒã«ã¯ããžã§ãã¬ãŒã¿ãŒã®éçºè
ã«ãã£ãŠäœæããããããžã§ã¯ãã®ã¢ãã«ãšã³ãã£ãã£ãä»ããŠæ瀺çãŸãã¯æé»çã«äœ¿çšã§ãããããŸããŸãªã¿ã€ãã®ããããã·ã¹ãã ããã±ãŒãžã®å€§èŠæš¡ãªã»ãããå«ãŸããŠããŸãã éçºè
ããã±ãŒãžã¯ãã·ã¹ãã ããã±ãŒãžã®ååãšäžèŽããå¿
èŠã¯ãããŸããã
ãHello worldãã®ãããªåçŽãªãããžã§ã¯ãã®äŸã次ã«ç€ºããŸãã ããã§ã¯ããããžã§ã¯ãã®ãã£ã¬ã¯ããªæ§é ã¯èæ
®ããŸããã ãã®å Žåã2ã€ã®ãã¡ã€ã«ãäœæããå¿
èŠããããŸãããããžã§ã¯ãã®èª¬æãšããããžã§ã¯ãã®äžéšãšããŠã®ãŠãŒãã£ãªãã£ã®èª¬æã§ããããã®ååãäœæããŸãã
ãããžã§ã¯ãåãããã«ã¡ã¯ããããžã§ã¯ãå
ã®ãŠãŒãã£ãªãã£ã®ååã¯worldã§ãã 次ã«ãhello.genãšworld.utilityã®2ã€ã®ããã¹ããã¡ã€ã«ãäœæããå¿
èŠããããŸãã
Hello.genãã¡ã€ã«ïŒ
é衚瀺ã®ããã¹ãproject hello /version="01.001" utility world
World.utilityãã¡ã€ã«ïŒ
é衚瀺ã®ããã¹ã utility world:"world" main { dprint("Hello world!"); }
ãã®ãããªãããžã§ã¯ãã®çæããã³ã¢ã»ã³ããªã®çµæãå®è¡å¯èœã¢ãžã¥ãŒã«world.exeïŒMS Windowã®å ŽåïŒãŸãã¯worldïŒUnixã®å ŽåïŒãååŸãããŸãã èµ·åæã«ãããã°ã©ã ã¯ã³ã³ãœãŒã«ã«æååãHello worldïŒããåºåããŸãã
ããè€éãªäŸãèããŠã¿ãŸãããããã®äŸã§ã¯ããŠãŒãã£ãªãã£ããã±ãŒãžã«å ããŠãã¿ã€ãããã±ãŒãžã®åçŽãªããã±ãŒãžã䜿çšãããŸãã
Pkgexample.genãã¡ã€ã«ïŒ
é衚瀺ã®ããã¹ã project pkgexample /version="01.001" package mypkg utility myutl
Mypkg.packageãã¡ã€ã«ïŒ
é衚瀺ã®ããã¹ã package mypkg type t_myint : int; fprocdecl sum(t_myint a,t_myint b,out t_myint c); implementation fproc localsum(t_myint x,t_myint y,out t_myint z) { z := x+y; } fprocdecl sum(t_myint a,t_myint b,out t_myint c) { call localsum(a,b,c); }
Myutl.utilityãã¡ã€ã«ïŒ
é衚瀺ã®ããã¹ã utility myutl:"myutl" main { var mypkg.t_myint p := 3, mypkg.t_myint q := 5, mypkg.t_myint r; call mypkg.sum(p,q,r); dprint("p=",p," q=",q," r=",r,"\n"); }
ãã®å Žåããããžã§ã¯ãã®äžéšãšããŠãmypkgãœãããŠã§ã¢ããã±ãŒãžãšmyutlãŠãŒãã£ãªãã£ã®2ã€ã®ããã±ãŒãžããããŸãã
mypkgããã±ãŒãžã§ã¯ãå€éšä»æ§ã®ã»ã¯ã·ã§ã³ïŒimplementationããŒã¯ãŒãã®åïŒã§ãt_myintåã®èª¬æã¯åºæ¬åintïŒ32ãããæŽæ°ïŒãã掟çãã2ã€ã®å
¥åãã©ã¡ãŒã¿ãŒaãbãšt_myintåã®2ã€ã®å
¥åãã©ã¡ãŒã¿ãŒãš1ã€ã®åºåãã©ã¡ãŒã¿ãŒãæã€sumããã·ãŒãžã£ã®ä»æ§åãã¿ã€ãã
implementaionããŒã¯ãŒãã®åŸã«ââèšè¿°ããããã®ã¯ãã¹ãŠãããã±ãŒãžå
ã§ã®ã¿äœ¿çšå¯èœã§ãã
localsumããã·ãŒãžã£ã«ã¯ãå€éšã®sumããã·ãŒãžã£ãšåæ§ã®èŠåºãããããŸãããfprocããŒã¯ãŒãã§å§ãŸããŸããããã¯ãããŒã«ã«ãªããžã§ã¯ãã§ããããšãæå³ããŸãã ããããŒã®åŸã«ãã»ãã³ãã³ã®ä»£ããã«ãäžæ¬åŒ§ã§å²ãŸããã¹ããŒãã¡ã³ãã®ãããã¯ããããŸããããã¯ãCã®ã¹ããŒãã¡ã³ããšãã䌌ãŠããŸãã ãããã¯å
ã«ã¯ã1ã€ã®ä»£å
¥æŒç®åããããŸãã äžåãªå¹³çãšã¯ç°ãªããããã§ã®å²ãåœãŠã¯ãïŒ=ããšããæåã§äžããããŸãã
åºæ¬çãªæ°åŠæè²ãåããçºé»æ©ã®éçºè
ã«ãšã£ãŠãa = a + 1ã®ãããªCèšèªã®ãããªæ§é ãèŠãã®ã¯èŠçã§ããã ãã®ãããªæŒç®åã§ã¯è»é¡ãã¹ã«ã«è¡šèšã䜿çšããããšã決å®ãããŸããã
ããŒã«ã«localsumããã·ãŒãžã£ã®åŸãä»æ§ã»ã¯ã·ã§ã³ã§å®£èšãããåèšå€éšããã·ãŒãžã£ã®æ¬äœãæ€çŽ¢ãããŸãã 以åã«æå®ãããããã·ãŒãžã£ã®èª¬æã¯ãããŒã«ã«ããã·ãŒãžã£ã®èª¬æã«äŒŒãŠããŸãããããŒã¯ãŒãfprocdeclãšãã©ã¡ãŒã¿ã®æ£ç¢ºãªã³ããŒããããŸãã 次ã¯ãããŒã«ã«ããã·ãŒãžã£ã³ãŒã«localsumãé
眮ãããŠããããã·ãŒãžã£ã®æ¬äœãããã¯ã§ãã
myutlããã±ãŒãžã«ã¯ãäžæ¬åŒ§ã§å²ãŸããã¹ããŒãã¡ã³ããããã¯ãå«ãåäžã®ã¡ã€ã³ã»ã¯ã·ã§ã³ããŸã ãããŸãã ãŠãŒãã£ãªãã£ã®ã¡ã€ã³ã»ã¯ã·ã§ã³ã¯ãããã±ãŒãžã®æåŸã«ãã1ã€ã®ã€ã³ã¹ã¿ã³ã¹ã«ããå¿
èŠããããŸãã ããã¯ãCã®ã¡ã€ã³é¢æ°ã®é¡äŒŒç©ã§ãã ãã®ãããã¯ã®ã¹ããŒãã¡ã³ãã¯ããŠãŒãã£ãªãã£ã®èµ·åæã«å®è¡ãããŸãã
ãããã¯ã«ã¯3ã€ã®æŒç®åããããŸãã æåã®æŒç®åã¯3ã€ã®å€æ°pãqãrã®èª¬æã§ãããæåã®2ã€ã¯å®æ°åŒã§åæåãããŸãã å€æ°ã¿ã€ãã¯ãããã±ãŒãžåã®åŸã«ããããç¶ãããã®ããã±ãŒãžã§å®çŸ©ãããã¿ã€ãåãç¶ã圢åŒã§æå®ãããŸãã
2çªç®ã®ã¹ããŒãã¡ã³ãã¯ãã¿ã€ããªã©ã®ãã€ã³ãåŒã§æå®ãããmypkgããã±ãŒãžããã®sumããã·ãŒãžã£ã®åŒã³åºãã§ãã
3çªç®ã®ãªãã¬ãŒã¿ãŒã¯ãã³ã³ãœãŒã«ãžã®ãããã°å°å·ã§ãã
2ã€ã®æŽæ°å®æ°ã®åèšãèšç®ããããã®ãã®ãããªæã®èŸŒãã ããã°ã©ãã³ã°ã¯ãå
¬éãããããã¹ãã®æå°ãµã€ãºã§å¯èœãªéãå€ãã®ããŒã¹èšèªã®å¯èœæ§ã瀺ãç®çã§ã®ã¿è¡ãããŸããã
ããè€éãªäŸã¯ãããã¥ã¡ã³ãã¿ã€ãã®æäœã瀺ããŠããŸãã
docexample.genãã¡ã€ã«ïŒ
é衚瀺ã®ããã¹ã project docexample /version="01.001" package doc utility doctest
Doc.packageãã¡ã€ã«ïŒ
é衚瀺ã®ããã¹ã package doc type t_orgname : char8[100]; type t_addr : char8[100]; type t_phone : char8[30]; type t_empname : char8[100]; type orgs : dqueue ( record org ( t_orgname orgname, t_addr addr, t_phone phone ); record emp ( t_empname empname1, t_empname empname2, t_empname empname3, t_addr addr, t_phone phone ); set orgs_org member org;/oper=(mem,next) set org_emp owner org member emp;/oper=(mem,next) ); procdecl fill(orgs porgs); implementation procdecl fill(orgs porgs) { var int iorg; rand.init(); for ( iorg := 0; iorg < 6; iorg += 1 ) { var org xorg, int iemp; org_cre(porgs,xorg); rand_test.firm8(xorg.orgname); rand_test.addr8(false,xorg.addr); rand_test.phone(xorg.phone); orgs_org_ins(porgs,xorg,-1); for ( iemp := 0; iemp < 8; iemp += 1 ) { var emp xemp; emp_cre(xorg.xdoc,xemp); rand_test.name8(xemp.empname1,xemp.empname2,xemp.empname3); rand_test.addr8(true,xemp.addr); rand_test.phone(xemp.phone); org_emp_ins(xorg,xemp,-1); } } }
Doctest.utilityãã¡ã€ã«ïŒ
é衚瀺ã®ããã¹ã utility doctest:"doctest" proc test(doc.orgs porgs) { call doc.fill(porgs); { var doc.org xorg; doc.orgs_org_mem(porgs,0,xorg); while ( isnotnull(xorg) ) { dprint("\n"); dprint(U": ",xorg.orgname,"\n"); dprint(U": ",xorg.addr,"\n"); dprint(U": ",xorg.phone,"\n"); var doc.emp xemp; doc.org_emp_mem(xorg,0,xemp); while ( isnotnull(xemp) ) { dprint("\n"); dprint(U" : ",xemp.empname1,"\n"); dprint(U" : ",xemp.empname2,"\n"); dprint(U" : ",xemp.empname3,"\n"); dprint(U" : ",xemp.addr,"\n"); dprint(U" : ",xemp.phone,"\n"); doc.org_emp_next(xemp); } doc.orgs_org_next(xorg); } } } main { varobj doc.orgs porgs; call test(porgs); }
docexampleãããžã§ã¯ãã«ã¯ãdoc.packageãšdoctest.utilityã®2ã€ã®ããã±ãŒãžãå«ãŸããŠããŸãã
docããã±ãŒãžã¯ãæå®ãããé·ãã®UTF-8ãšã³ã³ãŒãã£ã³ã°ã§æååt_orgnameãt_addrãt_phoneãt_empnameãèšè¿°ããŸãã
type orgs-documentïŒdqueueããŒã¯ãŒãïŒã çµç¹orgãšempã®2çš®é¡ã®ã¬ã³ãŒã-çµç¹ãšåŸæ¥å¡ã«ã€ããŠèª¬æããŸãã æ¬åŒ§å
ã«ã¯ã瀺ãããã¿ã€ãã®ã¬ã³ãŒãã®ã³ã³ããŒãã³ãããªã¹ããããŠããŸãã æ¬è³ªçã«ãããã¯ã2ã€ã®ããŒãã«ãšãã®äžã®æå®ãããåã§ããŒã¿ããŒã¹ãèšè¿°ããããšã«äŒŒãŠããŸãã
ãããã¯ãŒã¯æ§é ã¯ã1察å€ã®ã¬ã³ãŒãéã®é¢ä¿ã«ãã£ãŠå®çŸ©ãããŸãã ãã®ãããªé¢ä¿ã¯ã»ãããšããŠå°å
¥ãããŸãã ãããã£ãŠãorg_empã»ããã¯çµç¹ãšåŸæ¥å¡ã®é¢ä¿ãå°å
¥ããå€ãã®åŸæ¥å¡ãçµç¹ã§åãããšãã§ããŸãããååŸæ¥å¡ã¯1ã€ã®çµç¹ã§ããåããŠããŸããã ownerããŒã¯ãŒãã¯ãã»ããã®ã¬ã³ãŒãææè
ã¿ã€ããèšå®ããŸãã ããŒã¯ãŒãã¡ã³ããŒïŒã»ããã¡ã³ããŒïŒã¯ãã»ããã®ã¡ã³ããŒã¬ã³ãŒãã®ã¿ã€ããæå®ããŸãã
ææè
ã®ãªãã³ã¬ã¯ã·ã§ã³ïŒãã®äŸã§ã¯orgs_orgïŒã¯åæ°åœ¢ãšåŒã°ããããã¥ã¡ã³ãå
ã®åäžã®ã³ããŒã«ååšããŸãïŒãã®ææè
ã¯æ¡ä»¶ä»ãã§ããã¥ã¡ã³ã/ããŒã¿ããŒã¹å
šäœã§ãïŒã
ããã¥ã¡ã³ãã¿ã€ã宣èšã¯ããã®ãããªããã¥ã¡ã³ãã®ã¬ã³ãŒãã¿ã€ãããã¬ã³ãŒãã®ååãšäžèŽããååã§èªåçã«å®£èšããŸãã ãã®éãããã±ãŒãžå
ã®ååã®äžææ§ã«çæããŠãã ããã
ããã«ãåã¬ã³ãŒãããã³åã»ããã«å¯ŸããŠããããã®ãªããžã§ã¯ããæäœããæé ãèªåçã«çæãããå©çšå¯èœã«ãªããŸãã
ãã®ãããçµç¹ã¬ã³ãŒãã®å Žåãããã¥ã¡ã³ããžã®ãªã³ã¯ãäœæãããã¬ã³ãŒãã€ã³ã¹ã¿ã³ã¹ãžã®ãªã³ã¯ãååŸããããã®ã¬ã³ãŒãã¿ã€ãã®åºåå€æ°ãšãã2ã€ã®ãã©ã¡ãŒã¿ãŒã§org_creããã·ãŒãžã£ãäœæãããŸãã
org_emp_insããã·ãŒãžã£ã¯ã3ã€ã®ãã©ã¡ãŒã¿ãŒãæã€org_empã»ããã«å¯ŸããŠäœæãããŸãïŒorgåã®ã€ã³ã¹ã¿ã³ã¹ãžã®åç
§-ã»ããã®ææè
ã¬ã³ãŒããempåã®ã€ã³ã¹ã¿ã³ã¹ãžã®åç
§-ã»ããã¡ã³ããŒã®ã¬ã³ãŒããæŽæ°-ã»ããå
ã®äœçœ®ïŒè² ã®æ°-ã»ããã®æ«å°Ÿããã®çªå·ä»ãïŒã
org_emp_memããã·ãŒãžã£ã¯ã3ã€ã®ãã©ã¡ãŒã¿ãŒãæã€org_empã»ããã«å¯ŸããŠãäœæãããŸãïŒorgåã®ã€ã³ã¹ã¿ã³ã¹ãžã®åç
§âã»ããã®ææè
ã¬ã³ãŒããæŽæ°âã»ããå
ã®äœçœ®ãããã³åºåãã©ã¡ãŒã¿ãŒâ empåã®ã€ã³ã¹ã¿ã³ã¹ãžã®åç
§âã¡ã³ããŒã®ã¬ã³ãŒãã
org_empã»ããã®å Žåã1ã€ã®empåãã©ã¡ãŒã¿ãŒïŒå
¥åããã³åºåïŒã䜿çšããŠorg_emp_nextããã·ãŒãžã£ãŒãäœæãããã»ããã®æ¬¡ã®èŠçŽ ã«ç§»åããŸãã
å€æ©èœåŒisnullïŒ...ïŒããã³isnotnullïŒ...ïŒã¯ãããã¥ã¡ã³ãã¬ã³ãŒããªã©ã®å€æ°ã«é©çšãããŸãã
ãã®ãããžã§ã¯ãã§ã¯ãrandããã³rand_testã·ã¹ãã ããã±ãŒãžã䜿çšããŠãã©ã³ãã ãªãã¹ãããŒã¿ãçæããŸãã
解æã®åã瀺ãããã«ãå¥ã®ãµã³ãã«ãããžã§ã¯ããæ€èšããŠãã ããã
Calc.genãã¡ã€ã«ïŒ
é衚瀺ã®ããã¹ã project calc /version="01.001" utility calc
Calc.utilityãã¡ã€ã«ïŒ
é衚瀺ã®ããã¹ã utility calc:"Calculator" type t_double : double; /frac=6 procspec syn_add(string7 buf,tlex.t_lex xlex,out t_double dval); proc syn_fact(string7 buf,tlex.t_lex xlex,out t_double dval) { dval := 0.0; if ( tlex.sample(buf,xlex,"(") ) { call syn_add(buf,xlex,dval); tlex.sample_err(buf,xlex,")"); } else if ( tlex.double(buf,xlex,NOSIGN,NOFRAC,NOEXPON,dval) ) ; else tlex.message(buf,xlex,"syntax error"); } proc syn_mul(string7 buf,tlex.t_lex xlex,out t_double dval) { call syn_fact(buf,xlex,dval); for ( ; ; ) { var t_double dval1; if ( tlex.sample(buf,xlex,"*") ) { call syn_fact(buf,xlex,dval1); dval *= dval1; } else if ( tlex.sample(buf,xlex,"/") ) { call syn_fact(buf,xlex,dval1); dval /= dval1; } else break; } } proc syn_add(string7 buf,tlex.t_lex xlex,out t_double dval) { var bool minus; if ( tlex.sample(buf,xlex,"+") ) ; else if ( tlex.sample(buf,xlex,"-") ) minus := true; call syn_mul(buf,xlex,dval); if ( minus ) dval := -dval; for ( ; ; ) { var t_double dval1; if ( tlex.sample(buf,xlex,"+") ) { call syn_mul(buf,xlex,dval1); dval += dval1; } else if ( tlex.sample(buf,xlex,"-") ) { call syn_mul(buf,xlex,dval1); dval -= dval1; } else break; } } proc syn(string7 buf,tlex.t_lex xlex,out t_double dval) { call syn_add(buf,xlex,dval); tlex.eof_err(buf,xlex); } main { if ( utl.argc(xutl.yutl) <> 2 ) error U" "; var tlex.t_lex xlex, t_double dval; call syn(utl.argv7(xutl.yutl,1),xlex,dval); dprint("result=",dval,"\n"); }
èšç®ãŠãŒãã£ãªãã£ã®éçºã衚瀺ããããã®å
¥åã§åŒãæäŸãããåºåã§åŒã®èšç®å€ãæäŸãããŸãã
tlex解æã·ã¹ãã ããã±ãŒãžã䜿çšãããšããã®ããã±ãŒãžã®å¹
åºãçµã¿èŸŒã¿æ©èœã䜿çšããŠãéåžžã«ã·ã³ãã«ã§æå°éã®ã³ãŒãã§åŒã解æããã¿ã¹ã¯ã解決ã§ããŸãã ãã®äŸã¯ã解æã®åé¡ã解決ããããšãããã«ç°¡åã§ã³ã³ãã¯ãã§ãããã瀺ããŠããŸãã
ãããžã§ã¯ãã«ã¯tlexã·ã¹ãã ããã±ãŒãžãå«ãŸããŸã-æååã®åå¥è§£æã 解æã¯ãååž°éäžæ³ã䜿çšããŠè¡ãããŸãã åéçµç«¯ææ³ã·ã³ãã«ã¯ã解æããã°ã©ã ã®æé ã«å¯Ÿå¿ããŠããŸãã
ææ³ã¯ãã©ã®çµç«¯èšå·ãèªã¿åãäœçœ®ã«ããããèŠã€ããçµæã«åºã¥ããŠãæ§æ解æã«äœ¿çšããææ³èŠåã決å®ã§ããããã«çž®å°ããå¿
èŠããããŸãã ããããã®åœ¢åŒã«ããããšã¯ãã»ãšãã©ã®æ¢åã®èšèªã«ãšã£ãŠé£ããããšã§ã¯ãããŸããã ãããè¡ãã«ã¯ãåæææ³ã®èŠ³ç¹ãã誀ã£ãããã¹ããèš±å¯ãããµãèšèªãå®çŸ©ããã ãã§ååã§ãã å°æ¥çã«ã¯ãæ§ç¯ãããæ§æ解æããªãŒïŒäœããã®åœ¢åŒã§ïŒã«åºã¥ããŠãæ£ç¢ºæ§ã確èªã§ããŸãã
å®éãå®éã®ããã°ã©ã ã¯æèèªç±ææ³ã§èšè¿°ãããŠããªããããããã¯åžžã«å®éã®ç¿»èš³è
ã§è¡ãããŸãã KSã®ææ³ã§ã¯ãããŸããŸãªãªããžã§ã¯ãïŒåãããã·ãŒãžã£ãå€æ°ïŒã®äœ¿çšãçŠæ¢ãããŠããèšèªãèšè¿°ããããšã¯ã»ãšãã©ã§ããŸããã ãããã£ãŠããã®çš®ã®ãã§ãã¯ã¯ãšã«ããè¡ãããŸãã
ãã®å Žåãåæã¯ãã³ã³ãœãŒã«ã®ããã°ã©ã åŒã³åºãã®å
¥åãã©ã¡ãŒã¿ãŒæååã«å¯ŸããŠcalcãŠãŒãã£ãªãã£ã§å®è¡ãããŸãã ãã©ã¡ãŒã¿ãŒã1ã€ã ãæå®ããªããšããšã©ãŒã¡ãã»ãŒãžã衚瀺ãããŸãã ãã©ã¡ãŒã¿ãèšå®ãããŠããå Žåãçµæã®èšç®ã§è§£æãããŸãã åæãæåãããšãèšç®çµæãã³ã³ãœãŒã«ã«åºåãããŸãã ãšã©ãŒãçºçããå Žåããšã©ãŒãæ€åºãããããã¹ãã®äœçœ®ã瀺ãæ
å ±ãå«ã蚺æã¡ãã»ãŒãžãçºè¡ãããŸãã
èšèã®ææ³ã å ç®åŒã¯ãæŒç®èšå·+ãŸãã¯-ã§åºåãããä¹ç®åŒã®ã·ãŒã±ã³ã¹ã§ãã ä¹ç®åŒã¯ãæŒç®èšå·*ãŸãã¯/ã§åºåãããäžé£ã®å åã§ãã ä¹æ°ã¯ãã«ãã³å
ã®å ç®åŒãŸãã¯æ°å€ã§ãã
å ç®åŒã¯syn_addããã·ãŒãžã£ã«å¯Ÿå¿ããä¹ç®åŒã¯syn_mulã«å¯Ÿå¿ããä¹æ°ã¯syn_factã«å¯Ÿå¿ããŸãã
æ§ææé ã®ãã©ã¡ãŒã¿ãŒïŒbuf-åæããããã¹ããxlex-åå¥è§£æã³ã³ããã¹ãïŒèªã¿åãäœçœ®ãå«ãïŒãdval-åºåãã©ã¡ãŒã¿ãŒ-èšç®å€ã
tlexããã±ãŒãžã®åå¥è§£ææé ã䜿çšããŸããã
é¢æ°tlex.sample-çŸåšã®äœçœ®ã§ããã©ã¡ãŒã¿ãŒã«æ瀺ããããµã³ãã«ã®ååšã確èªããŸãã ãã¿ãŒã³ãæåã§å§ãŸãå Žåãèªèãããããã¹ãã¯ãã¿ãŒã³å
šäœãšäžèŽããå¿
èŠãããããµãã¹ããªã³ã°ãšããŠãã¿ãŒã³ãå«ãŸãªãå¿
èŠããããŸãã ã€ãŸã procãµã³ãã«ã®å¯çšæ§ã確èªãããšãèªã¿åãäœçœ®ã®procdeclããã¹ãã¯è¯å®çãªçµæã«ãªããŸããã ããŒã¯ã³ãèªèãããšããã¹ãŠã®ã¹ããŒã¹æåãè¡æ«ãã¿ããªã©ãã¹ããããããCããã³C ++ã®ã¹ã¿ã€ã«ã®ã³ã¡ã³ããã¹ããããããŸãã
Tlex.sample_errããã·ãŒãžã£-tlex.sampleããã·ãŒãžã£ã§ãµã³ãã«ã®æç¡ã確èªããååšããªãå Žåã¯ãåæãããæååã®èªã¿åãäœçœ®ã«é¢ããæ
å ±ãå«ãã¡ãã»ãŒãžããã¹ãã§èŽåœçãªãšã©ãŒãéå§ããŸãã
ãã®ãããªé¢æ°/ããã·ãŒãžã£ã®ãã¢ã¯ãå€ãã®çš®é¡ã®ããŒã¯ã³ã®tlexããã±ãŒãžã«ååšããŸãã ãã®é¢æ°ã䜿çšãããšãããŒã¯ã³ã®ååšã確èªã§ããããã·ãŒãžã£ããã§ãã¯ããäžåšã®å Žåã¯ãšã©ãŒãéå§ããŸãã
tlex.doubleããã·ãŒãžã£ãŒ-çŸåšã®äœçœ®ã§ã123.456圢åŒã®10é²æ°ã®ååšã確èªããŸãã NOSIGNãã©ã¡ãŒã¿ãŒã¯ãèªåœã¬ãã«ã§+-èšå·ãçŠæ¢ãããããã®æåãææ³ã¬ãã«ã§èªèããŸãã NOFRACãã©ã¡ãŒã¿ãŒã¯ãå°æ°ç¹ä»ããŸãã¯å°æ°ç¹ãªãã®æ°å€ãæå¹ã«ããŸãã
å°èš
åã®ã»ã¯ã·ã§ã³ã§ã¯ãã³ã¢èšèªæ©èœã®äžéšã瀺ããµã³ãã«ãããžã§ã¯ããæäŸããŸãã ããã¯ã¬ã€ãã§ã¯ãªããèšèªã®ã¬ã€ãã§ã¯ãªãããã¬ãŒãã³ã°ã®äŸã®ã»ããã§ããªãããšã«æ³šæããŠãã ããã ããã¯åãªã玹ä»æã§ãã
èªè
ããã®å Žæã«ãã©ãçããšãéåžžã«è«ççãªè³ªåããããŸã-ãã®åºæ¬èšèªã«ã¯ä»ã®èšèªã«ã¯ãªããã®ãããããã®å®è£
ã«ãšãã«ã®ãŒãšãéãè²»ããå¿
èŠãããã®ã¯ãªãã§ããïŒ
ãŸããããŒã¹èšèªã¯ããããžã§ã¯ããèšè¿°ããããã®å®å
šãªãžã§ãã¬ãŒã¿ãŒèšèªã®äžéšã§ãã ããŒã¿ããŒã¹ãSQLã¯ãšãªããµãŒããŒããµãŒããŒããŒããã¢ããªã±ãŒã·ã§ã³ãã¢ããªã±ãŒã·ã§ã³ç»é¢ã¬ã€ã¢ãŠãããã€ã¢ãã°ãæ§æãã¡ã€ã«ãä»»æã®ããŒã¿åã®JSONå€æãé¢é£ããŒãã«ã®æœè±¡ã»ãããªã©ã®ã¢ãã«ãšã³ãã£ãã£ãèšè¿°ããããã®ãžã§ãã¬ãŒã¿ãŒèšèªã«ã¯ãããŸããŸãªæ§é ããããŸããããŸããŸãªç°å¢ïŒdom-modelãgtkãqtïŒãªã©ã®ãããã³ã°ããã®ãªã¹ãã¯çµ¶ããæŽæ°ãããå€ããšã³ãã£ãã£ã¯æ¶æ»
ããæ°ãããšã³ãã£ãã£ã衚瀺ãããŸãã ãããŠããããã®æ§é ã¯ãã¹ãŠãäž»ã«åºæ¬èšèªã§å®è£
ãããŠããŸãã ãžã§ãã¬ãŒã¿ãŒéçºã®åæ段éã§ã¯ãã¢ãã«èšèšã¯Cã§çŽæ¥å®è£
ãããŸããã ããŒã¹èšèªã䜿çšãããšãã¢ãã«ãšèšèªã®çµ±åã容æã«ãªããŸããã
第äºã«ããžã§ãã¬ãŒã¿ãŒã¯ãããã°ã©ã ã³ãŒãã®éãæ°åäžè¡ã§æž¬å®ãããå Žåã«ã倧èŠæš¡ãããžã§ã¯ãã®å®è£
ãç®çãšããŠããŸãïŒãã®å Žåã®ã¿ã倧ããªå©ç¹ããããããŸãïŒã 倧ããªãããžã§ã¯ãã§ã®äœæ¥ã¯ãæ倧æ°åè¡ã®å°ããªããã°ã©ã ã®éçºãšã¯æ ¹æ¬çã«ç°ãªããŸãã å°ããªããã°ã©ã ã§ã¯ãéçºè
ã¯ãã®æ§é ã«é¢ãããã¹ãŠã®æ
å ±ãé ã®äžã«ä¿æã§ããŸãã 倧èŠæš¡ãªããã°ã©ã ã§ã¯ãããã¯äžå¯èœã§ãã ãã®ãããªããã°ã©ã ãå€æŽããéçšã§ãäœåãªæªäœ¿çšã³ãŒããå¿
ç¶çã«å¢å ããŸãã ãã®ããã»ã¹ã«å¯Ÿæããããã«ããžã§ãã¬ãŒã¿ãŒã¯å€æ°ã®æ段ãšã³ãŒããã§ãã¯ãè¡ããŸãã
ããã·ãŒãžã£ã®èŠåºãã§ã¯ãä»®ãã©ã¡ãŒã¿ã¯å
¥åãå
¥åããã³åºåãåºåã®ã¿ãšããŠæå®ãããŸãã ããã·ãŒãžã£æ¬äœã®å€æäžã«ããã®ä»æ§ã®æ£ç¢ºæ§ããã§ãã¯ãããŸãã ããšãã°ãç¹å®ã®ãã©ã¡ãŒã¿ãåºåãšããŠå®£èšãããŠãããããã·ãŒãžã£ã®æ¬æã«ãå€ãå²ãåœãŠãããåã«å€æ°ãèªã¿åãããããã«äœ¿çšããããã¹ãæŒç®åããªãŒã«ããå Žåããã®ç¶æ³ã¯ãšã©ãŒèšºæã«ã€ãªãããŸãã ããã¯ããã®ããã·ãŒãžã£ã§åŒã³åºãããä»ã®ããã·ãŒãžã£ã®å
¥åãšåºåã«é¢ããæ
å ±ã䜿çšããŸãã å€æ°ãæ§é ã®ã¿ã€ããæã£ãŠããå Žåããã®ãããªåæã¯ãä»»æã®ã¬ãã«ã§ãã®ã³ã³ããŒãã³ãããšã«å®è¡ãããŸãã
æ§é ããã¥ã¡ã³ãã®å Žåããã¹ãŠã®ã¬ã³ãŒããšã»ããã«å¯ŸããŠæäŸããããã¹ãŠã®æäœã®å®å
šãªã»ããã泚æã§ããŸãã ããã«ãããã³ãŒãã倧å¹
ã«åé·ã«ãªããŸãã åã¬ã³ãŒãããã³ã»ããã«å¿
èŠãªãã¹ãŠã®æäœã®ãªã¹ããæ瀺çã«èšå®ããããšãã§ããŸãïŒãããŠå¿
èŠã§ãïŒã ãã®å Žåããããžã§ã¯ãã§äœ¿çšãããªãã£ãæäœãç¹å®ãããé©åãªèšºæãçºè¡ãããŸãã ããã«ãããšãã°ãã¬ã³ãŒãäœææäœã䜿çšãããªãå Žåãããããšã©ãŒãšããŠæ±ãããŸãã ãŸãã¯ãã»ããã®å Žåãã»ããã«å«ãŸããŠäœ¿çšãããªããªã£ãæäœãããããããšã©ãŒãçæãããŸãã
ãã®ããã¹ããæžããŠããæç¹ã§ã¯ããããžã§ã¯ãã¢ãã«ã®å€ããšã³ãã£ãã£ãåé€ããããã»ã¹ããããŸããïŒå€ããµãŒããŒãšã¢ããªã±ãŒã·ã§ã³ã¯æ°ãããã®ã«çœ®ãæããããŸãïŒã å€ããªããžã§ã¯ããšæ°ãããªããžã§ã¯ããåæã«ååšãããšãã®ãžã§ãã¬ãŒã¿ãŒã³ãŒãã§ãããžã§ã¯ãã¢ãã«ãè¡šãããã¥ã¡ã³ãã«ã¯ãçŽ250çš®é¡ã®ã¬ã³ãŒããš800çš®é¡ä»¥äžã®ã»ããããããŸããã å€ããšã³ãã£ãã£ãåé€ãããšãã¬ã³ãŒãæ°ã¯190ã«æžå°ãã580ã«èšå®ãããŸããéåžžã«å€ãã®ãªããžã§ã¯ããšãããã®æäœã®äœ¿çšãæåã§è¿œè·¡ããããšã¯éåžžã«é£ããããšã¯æããã§ãã
å®äŸãšããŠãéè掻åã®åéã§ã®1ã€ã®å®éã®ãæ¢ã«å®äºãããããžã§ã¯ãã®ããŒã¿ã瀺ããŸãã ãžã§ãã¬ãŒã¿ãŒã®ãããžã§ã¯ãã«ã¯ãåèš203829è¡ã®1294ãã¡ã€ã«ãå«ãŸããŠããŸããã çµæã®Cã³ãŒãã«ã¯ã2608812è¡ã®ãã¡ã€ã«ã4605åãããŸããã ãããžã§ã¯ãã«ã¯23çš®é¡ã®ãµãŒããŒããªã¯ãšã¹ããåä¿¡ãã29ã®ããŒãã11ã®ã¢ããªã±ãŒã·ã§ã³ã27ã®ãŠãŒãã£ãªãã£ïŒã³ã³ãœãŒã«ããã°ã©ã ïŒããããããã¯1ã€ã ãã§ãããã·ã¹ãã å
šäœã§æ倧ã®ãããžã§ã¯ãã§ãã ãã®ã·ã¹ãã ã«ã¯ãåã
ã®ããã±ãŒãžã®ãšã¯ã¹ããŒããšã€ã³ããŒãã«ãã£ãŠçžäºæ¥ç¶ããã7ã€ã®ãããžã§ã¯ããå«ãŸããŠããŸããã ã·ã¹ãã ã7ã€ã®ç°ãªãçºé»æ©ãããžã§ã¯ãã«åå²ããçºé»éãåæžããŸããã åå·çãªæŽåæ§ãã§ãã«ãŒãªãã§ãã®ãããªçµæžã管çããããšã¯éåžžã«åé¡ã§ãã
çŸåšã®ç¶æ³
ãããžã§ã¯ããžã§ãã¬ãŒã¿ãŒã¯ãéçºäœæ¥ã®å
šæéãéããŠãéçºããŒã ã®å
éšãããžã§ã¯ããšããŠéçºãããŸããã é©çšããããããžã§ã¯ãã§äœæ¥ããéçšã§ãã客æ§ã¯å Žåã«ãã£ãŠã¯ããããžã§ã¯ãã«é¢é£ããäœããã®æ¹æ³ã§ãžã§ãã¬ãŒã¿ãŒã䜿çšããŠèªåã®éçºã«äœ¿çšããæ©äŒããããŸããïŒãããŠãå¶åŸ¡ããã®ãé£ããã ãã§ã¯ãããŸããïŒã ãããžã§ã¯ãã®äœæ¥äžã«ãã¿ã¹ã¯ã®ã¹ããŒãã¡ã³ããæ確ã«ãªããããŒã«ã®æ°ããããŒãºãçºçããŸãããããã¯ããžã§ãã¬ãŒã¿ã®æ¬¡ã®ããŒãžã§ã³ã§å®è£
ãããŸããã åé ã§è¿°ã¹ãããã«ãããã¯å¿çšãšæ段ã®2ã€ã®æ¬¡å
ã§ã®éçºã§ããã ã€ãŸã ãžã§ãã¬ãŒã¿ãŒã¯æ¬¡ã®ïŒæ¬¡ã®ïŒãããžã§ã¯ããšå
±ã«éçºãããŸããã å®æçã«ããžã§ãã¬ãŒã¿èªäœãäžè¬åãã®ãœãããŠã§ã¢è£œåã«ããããšã«ã€ããŠã®è©±ããããŸããã ãã®ããã¹ãã¯ãããæå³ã§ã¯ããã®ã·ã¹ãã ãéåžžã«äžè¬ã«å
¬éããè©Šã¿ã§ãã
çŸåšããžã§ãã¬ãŒã¿ã«ã¯ãããŸããŸãªããŒãžã§ã³ã®ããŒã¿ããŒã¹ç®¡çã·ã¹ãã OracleãPostgresãMySqlãMS SqlãSqliteãæäœããããã®ããŒã«ããããŸãã ããŒã¿ããŒã¹ã®æäœã«ã¯ããžã§ãã¬ãŒã¿ããŒã«ã䜿çšããããŒã¿ããŒã¹ã¹ããŒãã®èšè¿°ãããŒã¿ããŒã¹ã¹ããŒãå
ã®ã¯ãšãªããã¹ãã®å®å
šãªæ§æããã³ã»ãã³ãã£ãã¯å¶åŸ¡ã䜿çšããç¹å¥ãªèšèªïŒSQLã®ããªã代衚çãªãµãã»ããã䜿çšãããŸãïŒã§ã®SQLã¯ãšãªã®èšè¿°ãå«ãŸããŸãã ããŸããŸãªã¿ã€ãã®ããŒã¿ããŒã¹ã®ä»£æ¿ãæå®ããããŒã«ããããŸãã ãŸããããããåçã¯ãšãªãèšè¿°ã§ããŸããããã¯ãå¶åŸ¡ãªãã§ããŒã¿ããŒã¹ã«è»¢éãããŸãã
ãµãŒããŒã¯ææ°ã®ãããã¯ãŒã¯ããŒã«-Unixã®Epollããã³MS Windowsã®I / Oå®äºã«è»¢éãããŸãã
æè¿ãŸã§ãã¢ããªã±ãŒã·ã§ã³ã¯åäžã®ã€ã³ã¿ãŒãã§ã€ã¹ã¢ãã«ïŒãããããŠã£ã³ããŠã¬ã€ã¢ãŠãïŒã䜿çšããŠéçºãããMicrosoft WIN32 GUIãšUnixçšGTK-3ã®2ã€ã®å®è£
ããããŸãããããã2ã€ã®ã·ã¹ãã ã®1ã€ã®ã¢ãã«ãç¶æããããšã¯ãWIN32 GUIã®éçºããŒã«ãæªçºéã§ããããããŸããŸãå°é£ã«ãªã£ãŠããŸãããã®ãããGTK-3ãšQt-5ã®2ã€ã®ç°ãªãã¢ãããŒããçŸåšéçºãããŠããŸããã¢ãã«ã¯ç°ãªããŸãããéåžžã«äŒŒãŠããŸããããããåé¢ããããç°ãªãå®è£
ã§åã
ã®äŸå€ãšçµã¿åãããããšãã決å®ãäžããããŸã§ãWEBéçºã§äœ¿çšããJava Scriptããã±ãŒãžã®ãšã¯ã¹ããŒããç©æ¥µçã«éçºããŠããŸãããã©ãŠã¶ãŒã§ã¯ããµãŒããŒããjson圢åŒã®ããŒã¿ãåä¿¡ãããããžã§ã¯ãã§èšè¿°ãããã¿ã€ããæäœããããã®é¢æ°ã䜿çšã§ããŸããããšãã°ãJava Scriptçšã«çæãããæ§é ããã¥ã¡ã³ãã䜿çšã§ããŸããWEBéçºã§ã¯ãHTMLã®ããªã代衚çãªãµãã»ããããåºæ¬èšèªã§ã®æ¿å
¥ã䜿çšããŠå®è£
ãããŸãïŒPHPãšåæ§ïŒãåæã«ãHTMLããŒã¯ã¢ããã¯ããã¹ãã¿ã°ã®æ£ç¢ºæ§ã«ã€ããŠç£èŠãããŸãããããŠãã¡ãããããŒã¹èšèªã§ã®æ¿å
¥ã¯ããžã§ãã¬ãŒã¿ãŒå
šäœã§éäŸã§ããããã«ãå®å
šã«å¶åŸ¡ãããŸããäž»ã«ã¢ãã€ã«ãã©ãããã©ãŒã ïŒAndroidïŒã§ã³ã³ããŒãã³ãã·ã¹ãã ãéçºããããã«ãJavaèšèªãžã®ããã±ãŒãžã®ãšã¯ã¹ããŒããå®è£
ããŸããã