随笔分类 -  LALRPOP

7.3 Location Tracking 位置跟踪
摘要:https://lalrpop.github.io/lalrpop/location_tracking.html Sometimes it may be helpful to know where in the input stream a particular token was encounte 阅读全文

posted @ 2025-01-05 19:55 及途又八 阅读(41) 评论(0) 推荐(0)

7.2 Conditional compilation 条件编译
摘要:https://lalrpop.github.io/lalrpop/conditional-compilation.html LALRPOP support conditional compilation of non-terminal declarations via #[cfg(feature 阅读全文

posted @ 2025-01-05 19:49 及途又八 阅读(20) 评论(0) 推荐(0)

7.1 Generating files in the source tree 在源代码树中生成文件
摘要:https://lalrpop.github.io/lalrpop/generate_in_source.html Up to version 0.15, LALRPOP was generating its files in the same directory of the input file 阅读全文

posted @ 2025-01-05 19:45 及途又八 阅读(10) 评论(0) 推荐(0)

6.6 Error recovery with a custom lexer 使用自定义词法分析器进行错误恢复
摘要:https://lalrpop.github.io/lalrpop/lexer_tutorial/006_error_recovery_custom_lexer.html Features described in Error recovery work well with the custom l 阅读全文

posted @ 2025-01-05 19:31 及途又八 阅读(36) 评论(0) 推荐(0)

6.5 Using an external library 使用外部库
摘要:https://lalrpop.github.io/lalrpop/lexer_tutorial/005_external_lib.html Writing a lexer yourself can be tricky. Fortunately, you can find many librarie 阅读全文

posted @ 2025-01-05 16:33 及途又八 阅读(23) 评论(0) 推荐(0)

6.4 Using tokens with references 将令牌与引用一起使用
摘要:https://lalrpop.github.io/lalrpop/lexer_tutorial/004_token_references.html When using a custom lexer, you might want tokens to hold references to the 阅读全文

posted @ 2025-01-05 16:13 及途又八 阅读(11) 评论(0) 推荐(0)

6.3 Writing a custom lexer
摘要:https://lalrpop.github.io/lalrpop/lexer_tutorial/003_writing_custom_lexer.html Let's say we want to parse the Whitespace language, so we've put togeth 阅读全文

posted @ 2025-01-05 16:02 及途又八 阅读(26) 评论(0) 推荐(0)

6.2 Lexing raw delimited content 对原始分隔内容进行词法排序
摘要:https://lalrpop.github.io/lalrpop/lexer_tutorial/002_raw_delimited_content.html Our calculator example operated on numbers and arithmetic operators. T 阅读全文

posted @ 2025-01-05 15:36 及途又八 阅读(27) 评论(0) 推荐(0)

6.1 LALRPOP's lexer generator LALRPOP 的词法分析器生成器
摘要:This example dives a bit deeper into how LALRPOP works. In particular, it dives into the meaning of those strings and regular expression that we used 阅读全文

posted @ 2025-01-05 14:50 及途又八 阅读(80) 评论(0) 推荐(0)

6 Controlling the lexer : Fine control over the lexer 控制词法分析器 : 对词法分析器进行精细控制
摘要:https://lalrpop.github.io/lalrpop/lexer_tutorial/index.html This part is about controlling the inner workings of LALRPOP's built-in lexer generator an 阅读全文

posted @ 2025-01-05 14:09 及途又八 阅读(6) 评论(0) 推荐(0)

5.9 Passing state parameter 传递 state 参数
摘要:By default, the parser doesn't take any argument other than the input. When building the AST, it might be useful to pass parameters to the parser, whi 阅读全文

posted @ 2025-01-05 14:04 及途又八 阅读(25) 评论(0) 推荐(0)

5.8 Error recovery 错误恢复
摘要:By default, the parser will stop as soon as it encounters an error. Sometimes though we would like to try and recover and keep going. LALRPOP can supp 阅读全文

posted @ 2025-01-05 13:53 及途又八 阅读(38) 评论(0) 推荐(0)

5.6 Macros
摘要:Frequently when writing grammars we encounter repetitive constructs that we would like to copy-and-paste. A common example is defining something like 阅读全文

posted @ 2025-01-05 12:06 及途又八 阅读(21) 评论(0) 推荐(0)

5.5 Building ASTs
摘要:Of course, most of the time, when you're parsing you don't want to compute a value, you want to build up some kind of data structure. Here's a quick e 阅读全文

posted @ 2025-01-05 11:31 及途又八 阅读(18) 评论(0) 推荐(0)

5.4 Handling full expressions
摘要:Now we are ready to extend our calculator to cover the full range of arithmetic expressions (well, at least the ones you learned in elementary school) 阅读全文

posted @ 2025-01-05 11:04 及途又八 阅读(30) 评论(0) 推荐(0)

5.3 Type inference 类型推断
摘要:https://lalrpop.github.io/lalrpop/tutorial/003_type_inference.html OK, now that we understand the calculator1 example, let's look at some of the short 阅读全文

posted @ 2025-01-05 10:36 及途又八 阅读(15) 评论(0) 推荐(0)

Rust中以下三个东西是什么?有什么用? #[automatically_derived] #[allow(clippy::ptr_arg)] #[rustfmt::skip]
摘要:Rust中以下三个东西是什么?有什么用? #[automatically_derived] #[allow(clippy::ptr_arg)] #[rustfmt::skip] gpttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt 阅读全文

posted @ 2024-12-29 19:52 及途又八 阅读(70) 评论(0) 推荐(0)

5. LALRPOP Tutorial LALRPOP 教程
摘要:https://lalrpop.github.io/lalrpop/tutorial/index.html This is a tutorial for how to write a complete parser for a simple calculator using LALRPOP. If 阅读全文

posted @ 2024-12-29 19:10 及途又八 阅读(93) 评论(0) 推荐(0)

4. Cheatsheet 备忘单
摘要:https://lalrpop.github.io/lalrpop/cheatsheet.html Users of Lalrpop have compiled the following cheatsheet table as a quick way to look up useful Lalrp 阅读全文

posted @ 2024-12-29 18:57 及途又八 阅读(11) 评论(0) 推荐(0)

3. Quick Start Guide 快速入门指南
摘要:For getting started with LALRPOP, it's probably best if you read the tutorial, which will introduce you to the syntax of LALRPOP files and so forth. G 阅读全文

posted @ 2024-12-29 18:41 及途又八 阅读(102) 评论(0) 推荐(0)

导航