menu Error0 Blog
编译原理知识点1
59 浏览 | 2020-01-13 | 分类:编译原理 | 标签:

字符串与字母表的定义

注:文章里的 _ 代表 下标,^ 代表次方 或 标记。

​ 例如:V_N V_T α->^+β

$$ V_N V_T \\ α =>^+β $$

字母表:非空有穷集合,字母表的元素称为 符号,里面包括 汉字、标点符号、数字等。

符号:字母表的元素,语法分析时的 单词 ,词法分析时的 源码字符

符号串:由 字母表 中的符号组成任何 有穷序列 称为符号串。

空符号串:无任何 符号 的符号串或 长度 为零的符号串,记作 ε 。(epsilon,音标/ep'silon/)

字符串集合:当A集合所有元素都是某个 字母表 的的元素,则A集合是该字母表的集合。

字符串相等:x和y 字符串 每个符号依次相等。

字符串长度:当 x=abc x长度就为3 ,则用|x| =3 代表字符串长度。

字符串集合的幂运算:a的0次方等于{ε} ,a的1次方等于{a}。a的n次方等于{aa...N-1} 当N>0。

字符串的闭包运算:A+ 称为A的 正闭包 ,A* 称为 闭包

A+ 集合定义:例如 A={a} ,A+ 等于{a,aa,aaa,aaa,aaaa }。

A*集合定义:{ ε ∪ A+ }。

文法与语言的形式定义

文法是对语言结构的定义描述,即从形式上用于描述和规定语言的结构称为文法或语法。

非终结符:可以被取代的符号,非空有穷集合。(比如变量)

终结符:不可分解的单位,非空有穷集合。(比如常量)

产生式:条件规则 ,非空又穷集合。例如 α -> β

文法G:定义为四元组 G( V_n , V_t , P , S)。其中V_n 为 非终结符, V_t为 终结符, P为 产生式 ,S为 识别符号开始符号。 V 通常表示 V_n和V_t 。

α -> β 推导,相当于 α替换β ,称为 直接推导。也可以称 β 直接归约 α。

如果α -> β 经过多步推导推出 步数n>0,标记为 α ->^+ β 或 α ->n+ β n为步数。 α ->^* β 包括有0步推导。

列子: 大写 字母代表 非终结符 小写字母代表 终结符

$$ S=>A \\ A=>c \\ $$

所以A->c 只需要1步推到 标记为:

$$ α =>^1 β $$

知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议

发表评论

email
web

全部评论 (共 36 条评论)

    CialisOnline
    2020-02-21 02:08
    discount viagra for sale can you have multiple orgasms with cialis acheter cialis discount
    tadmedzcom
    2020-02-14 08:05
    cialis pills dosage cialis at a discount price cialis for sale in usa
    CialisXtl
    2020-02-14 05:34
    non prescription viagra http://tadmedz.com where can i buy viagra cheap http://cialisxtl.com cheap levitra professional
    tadmedzcom
    2020-02-13 07:00
    buy now viagra cialis cialis 20mg price himalayan viagra sale
    CialisXtl
    2020-02-13 05:22
    cheap herbal viagra online http://tadmedz.com cheap viagra order online http://cialisxtl.com cialis and sleeping pills
    TadMedz
    2020-02-13 00:27
    cialis professional 20mg pills cialis money order cheap viagra uk sale
    TadMedz
    2020-02-13 00:11
    what is cialis pills purchasing cialis on the internet buy cialis online without rx
    TadMedz
    2020-02-12 23:54
    cialis cheap usa otc cialis buy cialis vegas
    TadMedz
    2020-02-12 23:38
    cheap viagra to buy online lowest cialis prices best place buy viagra online uk
    TadMedz
    2020-02-12 23:21
    levitra for sale cialis coupons order cialis daily
    Sildenafil
    2020-02-09 10:14
    buy cialis generic canada discount cialis cuanto sale el viagra en la argentina
    EuMedzPh
    2020-02-09 09:06
    viagra professional pills viagra for sale cheap uk buy viagra dubai
    Sildenafil
    2020-02-08 09:32
    cialis canada buy viagra no prescription canada cialis cheap canada
    Sildenafil
    2020-02-06 22:27
    goodrx cialis cialis generic buy generic cialis in usa
    MeEdMeds
    2020-02-06 13:29
    cialis for sale manila https://edmedz.com buy viagra with paypal
    MeEdMeds
    2020-02-06 12:55
    buy cheap viagra with mastercard https://edmedz.com levitra buy in uk
    MeEdMeds
    2020-02-06 11:08
    cheap viagra cialis online https://edmedz.com levitra for sale philippines
    MeEdMeds
    2020-02-06 10:47
    buy viagra tesco https://edmedz.com cialis for sale cheap
    MeEdMeds
    2020-02-06 10:27
    cheap cialis online https://edmedz.com cialis for sale in usa
    MeEdMeds
    2020-02-06 10:04
    buy cialis in canada https://edmedz.com how to buy real cialis online
    MedEdMedz
    2020-02-05 13:52
    order viagra from uk https://edmedz.com cheap viagra order online
    MedEdMedz
    2020-02-04 11:16
    buy viagra qld https://edmedz.com discount viagra professional
    MedEdMedz
    2020-02-03 08:28
    buy levitra with no prescription https://edmedz.com buy cialis black online
    MedEdMedz
    2020-02-02 14:19
    cheapest cialis price https://edmedz.com buy cialis brand
    MedEdMedz
    2020-02-01 18:57
    cialis buy australia https://edmedz.com can you buy levitra walmart
    EuMedzPh
    2020-01-31 08:02
    how to order viagra online buy cialis daily use cialis for sale online in canada
    MedEdMedz
    2020-01-30 23:03
    how to buy real cialis online https://edmedz.com cheap cialis in usa
    PhEuMedz
    2020-01-30 21:39
    cialis china cheap generic viagra sale usa buy viagra soft tabs
    PhEuMedz
    2020-01-30 20:59
    viagra cheap uk best place to order generic cialis order viagra toronto
    PhEuMedz
    2020-01-30 20:25
    buy viagra brisbane how to get cheap cialis buy viagra legal
    PhEuMedz
    2020-01-30 20:08
    viagra sale new zealand buy online viagra viagra order viagra from boots
    PhEuMedz
    2020-01-30 19:28
    buy viagra through paypal viagra sale ottawa legal buy generic cialis
    PhEuMedz
    2020-01-30 18:43
    herbal viagra sale best place to buy levitra where to order cialis online safe
    PhEuMedz
    2020-01-30 17:59
    viagra sale lloyds pharmacy buy cialis from europe real cialis pills
    PhEuMedz
    2020-01-30 17:14
    how to buy viagra cheap viagra super force 100mg 100mg pills buy levitra super active oo
    ahjkqxsfxp
    2020-01-24 21:14
    sWhwNd erjqckqlnwrt, [url=http://vspmkwusywhk.com/]vspmkwusywhk[/url], [link=http://llypxggnhlga.com/]llypxggnhlga[/link], http://juzivaudutfp.com/
Emoji

Warning: file_get_contents(/assets/json/owo.json): failed to open stream: No such file or directory in /www/wwwroot/build/usr/themes/Cuckoo/includes/owo.php on line 46

Warning: array_keys() expects parameter 1 to be array, null given in /www/wwwroot/build/usr/themes/Cuckoo/includes/owo.php on line 48

Warning: file_get_contents(/assets/json/owo.json): failed to open stream: No such file or directory in /www/wwwroot/build/usr/themes/Cuckoo/includes/owo.php on line 87

Warning: array_keys() expects parameter 1 to be array, null given in /www/wwwroot/build/usr/themes/Cuckoo/includes/owo.php on line 89