LALR法

Multi tool use
LALR法(英: LALR parser)は、構文解析手法の一種であり、Lookahead(先読み)LR法の略である。単純LR法(SLR法)の構文解析器よりも多くの文脈自由文法を扱うことができる。構文解析表の大きさがあまり大きくなく、多くの文法を扱えることから、最も一般的な構文解析器となっている。yacc や GNU bison といったパーサジェネレータの多くもこの種の構文解析器を生成する。
SLR法と同様、LALR法では LR(0) の構文解析表を必要とする。SLR 法では Follow-set を使って reduce アクションを構築するのに対して、LALR法では Lookahead-set を使う。Lookahead-set は構文解析により特化している。Follow-set は関連する記号の集合だが、Lookahead-set はLR(0)アイテムと構文解析状態に特化した集合である。
ある LR(0) 文法での状態 S におけるアイテム I の Follow-set は、文法上 I の左辺の非終端記号の後に出現可能な全記号を含む。一方、状態 S におけるアイテム I の Lookahead-set は、状態 S で構文解析を開始したときの I の右辺に出現可能な記号のみを含む。follow(I) は左辺が同じ I である全 LR(0)アイテムの Lookahead-set の和集合と等価であり、状態やアイテムの右辺は考慮されていない。従って、Follow-set からは文脈情報が失われている。Lookahead-set は特定の構文解析向けであるため、さらに選別が可能で、Follow-set よりも詳細な識別が可能となる。
参考文献
- Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers: Principles, Techniques, and Tools. Addison--Wesley, 1986. (LALR(1)構文解析器の構築に関する従来からの技法の解説)
- Frank DeRemer and Thomas Pennello. Efficient Computation of LALR(1) Look-Ahead Sets. ACM Transactions on Programming Languages and Systems (TOPLAS) 4:4, pp. 615–649. 1982. (より効率的な LALR(1)構文解析器構築技法の説明)
- Richard Bornat Understanding and Writing Compilers, Macmillan, 1979. (構文解析と構文解析表などの基本原理を解説)
MUuPkU8,N0r7Vmzfrh9sluJSQ7Dv,3sMW
Popular posts from this blog
CARDNET は日本カードネットワークが運営するクレジット決済ネットワーク。日本カードネットワークの略称としてもCARDNETが使用されている。 事件・事故 2017年4月15日午前11時8分からクレジットカードの決済がしづらくなる障害が発生した。障害は同日午後5時18分に復旧した。原因は、複数あるCARDNETセンターの拠点のうち1つで、2重化してあるL3スイッチの片方が故障し、1系統にトラフィックが集中したことによる輻輳が発生したため。対処としては、故障したL3スイッチ交換とシステム再起動が行われた [1] 。 出典 ^ 金子寛人 ( 2017年4月17日 ). “CARDNETのクレジット決済に6時間強障害、原因はL3スイッチ故障”. 日経コンピュータ. 2018年10月18日 閲覧。 この項目は、コンピュータに関連した 書きかけの項目 です。この項目を加筆・訂正などしてくださる協力者を求めています(PJ:コンピュータ/P:コンピュータ)。 この項目は、経済に関連した 書きかけの項目 です。この項目を加筆・訂正などしてくださる協力者を求めています(ポータル 経済学、プロジェクト 経済)。 This page is only for reference, If you need detailed information, please check here
0
I am on a system dual-booting Windows and Debian (usually using the latter), and a recent Windows update appears to have wreaked havoc on the Debian boot system. I managed to boot Windows again, but not Linux. Following online suggestions, I created a Live USB of Ubuntu, and booted from that. Then I have installed and run the boot-repair utility. The utility instructs me to type several lines including sudo chroot "/mnt/boot-sav/sda6" apt-get purge -y grub*-common grub-common:i386 To which I receive the error E: Unable to locate package grub-common:i386 I am given to understand the issue may have to do with having UEFI vs BIOS (I believe I have UEFI), but do not understand this well. In any case I have subsequently run the boot-repair BootInfo Summary utility which created the following file h...
4
As per this answer, router and gateway are same devices, in terms of functionality. In AWS world, we have internet gateway, NAT gateway and router Are these three not the same?
amazon-web-services amazon-vpc gateway amazon-nat-gateway
share
edited 2 hours ago
user1787812
asked 2 hours ago
user1787812 user1787812
121 3
New contributor
user1787812 ...