2.2 从零开始用 Go 实现 Lexer & Parser - 何源从零开始用 Go 实现 Lexer & Parser 何源 yuan@liulishuo.com 流利说 流利说 Help everyone become a global citizen! aithub/lingochamp 流利说 Empower everyone to achieve their full potential 何源 yuan@liulishuo.com Platform WORK ELSEWHERE, DELETE THE PROJECT, AND DOWNLOAD A FRESH COPY. 撸起袖子! — 撸起袖子加油干! 三步走 写一个 Parser: course file -> pb file • 写一个 Lexer • 串起来 1. 定义格式 ===== Group 1526034270606411 [TYPE Pre] start of this item. } type itemType int const itemNil itemType = iota // used in the parser to indicate no type itemError // error occurred; value is text of error itemEOF itemBool0 码力 | 81 页 | 4.72 MB | 1 月前3
phpMyAdmin Documentation Release 5.0.5-devlimitations are as before. ## CSV using LOAD DATA Similar to CSV, only using the internal MySQL parser and not the phpMyAdmin one. ## ESRI Shape File The ESRI shapefile or simply a shapefile is a popular • Host authentication IP Allow/Deny • DB-based configuration (Not completed) • SQL parser and pretty-printer • SQL validator • many bugfixes and improvements • Armel Fauveau Export with table/column name changes • Dan Ungureanu (Google Summer of Code 2015) • New parser and analyzer • Nisarg Jhaveri (Google Summer of Code 2015) Page-related settings • SQL debugging0 码力 | 235 页 | 370.31 KB | 2 年前3
Flask-RESTful Documentation Release 0.3.10Arguments Multiple Values & Lists Other Destinations Argument Locations Multiple Locations Parser Inheritance Error Handling Error Messages Output Fields Basic Usage Renaming Attributes Default org/dev/library/argparse.html]. parser = reqparse.RequestParser() parser.add_argument('rate', type=int, help='Rate to charge for this') resource') args = parser.parse_args() ## Note strict=True ensures that an error is thrown if the request includes arguments your parser does not define. args = parser.parse_args(strict=True) ## Data Formatting By default, all fields in your return0 码力 | 42 页 | 84.60 KB | 2 年前3
The Beauty and Power of Primitive C++Given an IDL Now see what it takes to get what we want aka Design and implementation • We need a parser/generator • Generate “ideal” interfaces and implementations • Have a tools infrastructure based mplementation – “small is good” To be fast and correct, code has to be small and simple ## • IDL Parser/generator • IDL -> simple, general internal representation -> anything I want • Message descriptors 2,000 lines “forever” • Anything new will be unfamiliar ## Flats library and tools framework • Parser • Simple recursive descent • Generator • Object maps, Message descriptors, Message setup Red:0 码力 | 53 页 | 1.03 MB | 1 年前3
Expressive Compile-time Parserstypes, trees ## Parser parse(text or tokens) -> value or error In a compiler: tokens -> parser -> syntax tree In a web browser: text -> JSON parser -> JS object ## Parser Combinators Create a parser by combining existing parsers. parse_string_or_int(text, pos) -> parse_string(text, pos) || parse_int(text, pos) Simplified syntax: parse_string_or_int -> parse_string | parse_int parse_int ## Parser Generators Create a parser from a grammar. Popular parsing algorithms used in generators are LL, LL(k), LR, LR(k), LALR, GLR... EBNF grammar example: identifier = alphabetic character0 码力 | 134 页 | 1.73 MB | 1 年前3
Flask-RESTful Documentation
Release 0.3.6flask_restful import reqparse parser = reqparse.RequestParser() parser.add_argument('rate', type=int, help='Rate to charge for this resource') args = parser.parse_args() Note: Unlike the strict=True ensures that an error is thrown if the request includes arguments your parser does not define. args = parser.parse_args(strict=True) #### 1.2.5 Data Formatting By default, all fields in your abort(404, message="Todo {} doesn't exist".format(todo_id)) parser = reqparse.RequestParser() parser.add_argument('task') # Too # shows a single todo item and lets you delete0 码力 | 46 页 | 245.60 KB | 2 年前3
Flask-RESTful Documentation
Release 0.3.10flask_restful import reqparse parser = reqparse.RequestParser() parser.add_argument('rate', type=int, help='Rate to charge for this resource') args = parser.parse_args() Note: Unlike the strict=True ensures that an error is thrown if the request includes arguments your parser does not define. args = parser.parse_args(strict=True) #### 1.2.5 Data Formatting By default, all fields in your abort(404, message="Todo {} doesn't exist".format(todo_id)) parser = reqparse.RequestParser() parser.add_argument('task') # Too # shows a single todo item and lets you delete0 码力 | 39 页 | 212.29 KB | 2 年前3
Flask-RESTful Documentation
Release 0.3.7flask_restful import reqparse parser = reqparse.RequestParser() parser.add_argument('rate', type=int, help='Rate to charge for this resource') args = parser.parse_args() Note: Unlike the strict=True ensures that an error is thrown if the request includes arguments your parser does not define. args = parser.parse_args(strict=True) #### 1.2.5 Data Formatting By default, all fields in your abort(404, message="Todo {} doesn't exist".format(todo_id)) parser = reqparse.RequestParser() parser.add_argument('task') # Too # shows a single todo item and lets you delete0 码力 | 50 页 | 253.09 KB | 2 年前3
Flask-RESTful Documentation
Release 0.3.8flask_restful import reqparse parser = reqparse.RequestParser() parser.add_argument('rate', type=int, help='Rate to charge for this resource') args = parser.parse_args() Note: Unlike the strict=True ensures that an error is thrown if the request includes arguments your parser does not define. args = parser.parse_args(strict=True) #### 1.2.5 Data Formatting By default, all fields in your abort(404, message="Todo {} doesn't exist".format(todo_id)) parser = reqparse.RequestParser() parser.add_argument('task') # Too # shows a single todo item and lets you delete0 码力 | 50 页 | 253.64 KB | 2 年前3
Conda 23.10.x Documentationtxt. (#12984) ## Deprecations • Mark conda.cli.main.generate_parser as pending deprecation. Use conda.cli.conda_argparse. generate_parser instead. (#13144) • Mark conda.auxlib.collection.firstitem as cite conda. (#12781) • Add optional CondaSubcommand.configure_parser allowing third-party plugins to hook into conda's argument parser. (#12814) • Only display third-party subcommands in conda --help --help. (#12893) • Implement a 2-phase parser to better handle plugin disabling (via --no-plugins). (#12910) • Refactor subcommand parsing to use a greedy parser since argparse.REMAINDER has known issues0 码力 | 773 页 | 5.05 MB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100
相关搜索词
LexerParserGostatesactionsphpMyAdminMySQLMariaDBConfiguration storageSQL parserFlask-RESTfulREST APIResourcefieldsrequest parserPrimitive C++IDL ParserFlatsSpanC++Expressive Compile-time ParsersMetaprogramming TricksAPI DesignReflectionDomain Specific LanguagesFlask框架请求解析自定义错误处理FlaskRequest ParsingOutput FieldsHTTP methodsRequest parsingCustom error handlingAPIrequest parsingcustom fieldscondalibmamba-solverdeprecationsconfigurationenvironment variables













