LALR(1) grammar: Difference between revisions

From Lojban
Jump to navigation Jump to search
mNo edit summary
 
mNo edit summary
Line 1: Line 1:


1)
Special case of an [[jbocre: LALR|LALR]] grammar, with one token of look-ahead. Very much the preferred class of formal grammar as far as computer science is concerned, as it is much more tractable in parsing. Any language parsed by [[jbocre: YACC|YACC]] belongs to this subclass --- including [[jbocre: Lojban Description|Lojban Description]].
 
总字母数 = ``L''.
 
2)
 
单引号的个数 = ``A''.
 
3)
 
``y''-, ``r''- 和 ``n'' 连字符个数 = ``H''.
 
4)
 
对于每一个 rafsi, 在下面的表中找到对应值. 将所有 rafsi 的值加在一起称为 ``R'':
 
CVC/CV (置于最后)  (-sarji) 1
 
CVC/C              (-sarj-) 2
 
CCVCV (置于最后)  (-zbasu) 3
 
CCVC              (-zbas-) 4
 
CVC                (-nun-)  5
 
有单引号的 CVV    (-ta'u-) 6
 
CCV                (-zba-)  7
 
没有单引号的 CVV    (-sai-) 8
 
5)
 
不包括 ``y'' 的元音字母个数 = ``V''.
 
成绩是:
 
(1000 * L) - (500 * A) + (100 * H) - (10 * R) - V

Revision as of 16:57, 4 November 2013

Special case of an LALR grammar, with one token of look-ahead. Very much the preferred class of formal grammar as far as computer science is concerned, as it is much more tractable in parsing. Any language parsed by YACC belongs to this subclass --- including Lojban Description.