V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  NeoZephyr  ›  全部回复第 2 页 / 共 7 页
回复总数  131
1  2  3  4  5  6  7  
2023-04-28 13:26:20 +08:00
回复了 wei417739 创建的主题 程序员 找一个程序员大佬当师傅。求师
自己学呗,找同学一起练
都是什么垃圾老师啊
2023-04-20 17:26:05 +08:00
回复了 LiuJiang 创建的主题 程序员 被 B 站裁员,我思考了哪些?
这脑门儿可以啊

另外,后端可以加吗
2023-04-03 15:25:13 +08:00
回复了 NeoZephyr 创建的主题 Java antlr4 提供的 Java 词法文件, CHAR_LITERAL 规则怎么理解
怎么编辑自己的问题呢?

这种问题还是去 so 好一点,gpt 真是不靠谱,问了一个早上都没有问出结果
2023-04-03 10:46:27 +08:00
回复了 NeoZephyr 创建的主题 Java antlr4 提供的 Java 词法文件, CHAR_LITERAL 规则怎么理解
@proxytoworld

gpt 好像也是这么回答我的

但是,\n \r 不也是一个字符吗?这个有啥影响吗,实在是不懂啊
2023-03-31 14:45:58 +08:00
回复了 NeoZephyr 创建的主题 Java 有没有好心人帮忙 review 一下, Java 数字的词法解析实现
@popvlovs

我也想知道不用 antlr 这种工具,有啥比较好的办法实现 lexer
2023-03-30 22:12:47 +08:00
回复了 NeoZephyr 创建的主题 Java 有没有好心人帮忙 review 一下, Java 数字的词法解析实现
@lucaslee

手写的,我也没有想到比较好的办法
2023-03-30 22:12:17 +08:00
回复了 NeoZephyr 创建的主题 Java 有没有好心人帮忙 review 一下, Java 数字的词法解析实现
@kwh 我问了,他给的建议,感觉不大实用
2023-03-30 22:11:37 +08:00
回复了 NeoZephyr 创建的主题 Java 有没有好心人帮忙 review 一下, Java 数字的词法解析实现
@angryPHP

有的

```java
def "scan number without exception"() {
when:
Lexer lexer = new Lexer(source)
Token token = lexer.nextToken()

then:
kind == token.kind.name()
lexeme == token.lexeme

where:
source | kind | lexeme

// BINARY_LITERAL: '0' [bB] [01] ([01_]* [01])? [lL]?;
"0b0" | "BINARY_LITERAL" | "0b0"
"0b1" | "BINARY_LITERAL" | "0b1"
"0b000" | "BINARY_LITERAL" | "0b000"
"0b010" | "BINARY_LITERAL" | "0b010"
"0B0L" | "BINARY_LITERAL" | "0B0L"
"0b10___10l" | "BINARY_LITERAL" | "0b10___10l"
"0b000___0L" | "BINARY_LITERAL" | "0b000___0L"
"0b001___0L" | "BINARY_LITERAL" | "0b001___0L"

// OCT_LITERAL: '0' '_'* [0-7] ([0-7_]* [0-7])? [lL]?;

"0000" | "OCT_LITERAL" | "0000"
"0__007_2" | "OCT_LITERAL" | "0__007_2"
"0__7_0L" | "OCT_LITERAL" | "0__7_0L"
"07_0L" | "OCT_LITERAL" | "07_0L"
"0000l" | "OCT_LITERAL" | "0000l"
"0007l" | "OCT_LITERAL" | "0007l"
"0_00_77__0L" | "OCT_LITERAL" | "0_00_77__0L"

// HEX_LITERAL: '0' [xX] [0-9a-fA-F] ([0-9a-fA-F_]* [0-9a-fA-F])? [lL]?;

"0x0" | "HEX_LITERAL" | "0x0"
"0x000l" | "HEX_LITERAL" | "0x000l"
"0x0eeeL" | "HEX_LITERAL" | "0x0eeeL"
"0x000eee" | "HEX_LITERAL" | "0x000eee"
"0x1_E2E3e5" | "HEX_LITERAL" | "0x1_E2E3e5"
"0xe___ee_eL" | "HEX_LITERAL" | "0xe___ee_eL"

// DECIMAL_LITERAL: ('0' | [1-9] (Digits? | '_'+ Digits)) [lL]?;

"0L" | "DECIMAL_LITERAL" | "0L"
"0" | "DECIMAL_LITERAL" | "0"
"9l" | "DECIMAL_LITERAL" | "9l"
"99___9L" | "DECIMAL_LITERAL" | "99___9L"
"9___99___9L" | "DECIMAL_LITERAL" | "9___99___9L"
"9999" | "DECIMAL_LITERAL" | "9999"
"1_000_000" | "DECIMAL_LITERAL" | "1_000_000"

// HEX_FLOAT_LITERAL: '0' [xX] (HexDigits '.'? | HexDigits? '.' HexDigits) [pP] [+-]? Digits [fFdD]?;

"0x.fp012" | "HEX_FLOAT_LITERAL" | "0x.fp012"
"0x.f__f_fp-0012d" | "HEX_FLOAT_LITERAL" | "0x.f__f_fp-0012d"
"0xf_ffP12d" | "HEX_FLOAT_LITERAL" | "0xf_ffP12d"
"0xf_f.P-12d" | "HEX_FLOAT_LITERAL" | "0xf_f.P-12d"
"0xf_f.f_fP+12" | "HEX_FLOAT_LITERAL" | "0xf_f.f_fP+12"
"0x0.0000000fp-11" | "HEX_FLOAT_LITERAL" | "0x0.0000000fp-11"
"0xf_ff.P12d" | "HEX_FLOAT_LITERAL" | "0xf_ff.P12d"
"0X0P0f" | "HEX_FLOAT_LITERAL" | "0X0P0f"
"0X0P0" | "HEX_FLOAT_LITERAL" | "0X0P0"
"0X0_0__123P0f" | "HEX_FLOAT_LITERAL" | "0X0_0__123P0f"
"0XeP0f" | "HEX_FLOAT_LITERAL" | "0XeP0f"
"0X000.P0f" | "HEX_FLOAT_LITERAL" | "0X000.P0f"
"0X00e.P0f" | "HEX_FLOAT_LITERAL" | "0X00e.P0f"
"0X0e__0.0P0f" | "HEX_FLOAT_LITERAL" | "0X0e__0.0P0f"
"0X0e__0.0__0P0f" | "HEX_FLOAT_LITERAL" | "0X0e__0.0__0P0f"
"0X0e__0.0__e0P-0__0f" | "HEX_FLOAT_LITERAL" | "0X0e__0.0__e0P-0__0f"
"0X0e__0.0__e0P+0_1__0f" | "HEX_FLOAT_LITERAL" | "0X0e__0.0__e0P+0_1__0f"
"0X0.0__e0P+0_1__0f" | "HEX_FLOAT_LITERAL" | "0X0.0__e0P+0_1__0f"
"0X0.00P0f" | "HEX_FLOAT_LITERAL" | "0X0.00P0f"
"0X0.0eP0f" | "HEX_FLOAT_LITERAL" | "0X0.0eP0f"
"0X0.e__00P0f" | "HEX_FLOAT_LITERAL" | "0X0.e__00P0f"
"0X0.e__00__0P0f" | "HEX_FLOAT_LITERAL" | "0X0.e__00__0P0f"
"0X0.e__00__e0P-0__0f" | "HEX_FLOAT_LITERAL" | "0X0.e__00__e0P-0__0f"
"0X0e.0__00__e0P+0_1__0f" | "HEX_FLOAT_LITERAL" | "0X0e.0__00__e0P+0_1__0f"
"0X.0__00__e0P-0_1__0F" | "HEX_FLOAT_LITERAL" | "0X.0__00__e0P-0_1__0F"
"0X.0__00__e0P-0_1__0" | "HEX_FLOAT_LITERAL" | "0X.0__00__e0P-0_1__0"

// FLOAT_LITERAL: (Digits '.' Digits? | '.' Digits) ExponentPart? [fFdD]?;
// FLOAT_LITERAL: Digits (ExponentPart [fFdD]? | [fFdD]);
// ExponentPart: [eE] [+-]? Digits

"0f" | "FLOAT_LITERAL" | "0f"
"00f" | "FLOAT_LITERAL" | "00f"
"0__0_0f" | "FLOAT_LITERAL" | "0__0_0f"
"0001f" | "FLOAT_LITERAL" | "0001f"
"0e0f" | "FLOAT_LITERAL" | "0e0f"
"0e0" | "FLOAT_LITERAL" | "0e0"
"1e1" | "FLOAT_LITERAL" | "1e1"
"0_0e-0_0f" | "FLOAT_LITERAL" | "0_0e-0_0f"
"0_0e0_120f" | "FLOAT_LITERAL" | "0_0e0_120f"
"0001e0009" | "FLOAT_LITERAL" | "0001e0009"
"000012345e1" | "FLOAT_LITERAL" | "000012345e1"
"0_00___9900d" | "FLOAT_LITERAL" | "0_00___9900d"
".0" | "FLOAT_LITERAL" | ".0"
".0e0" | "FLOAT_LITERAL" | ".0e0"
".0_000" | "FLOAT_LITERAL" | ".0_000"
".0___0990" | "FLOAT_LITERAL" | ".0___0990"
".000e0__0__0" | "FLOAT_LITERAL" | ".000e0__0__0"
".000e0__0__0f" | "FLOAT_LITERAL" | ".000e0__0__0f"
".000e-0__9__0f" | "FLOAT_LITERAL" | ".000e-0__9__0f"
".9e-0__1_0f" | "FLOAT_LITERAL" | ".9e-0__1_0f"
"0__00." | "FLOAT_LITERAL" | "0__00."
"0__090." | "FLOAT_LITERAL" | "0__090."
"99__9." | "FLOAT_LITERAL" | "99__9."
"000.000" | "FLOAT_LITERAL" | "000.000"
"0__10.090" | "FLOAT_LITERAL" | "0__10.090"
"000__1_0.090" | "FLOAT_LITERAL" | "000__1_0.090"
"000__1_0.090e12" | "FLOAT_LITERAL" | "000__1_0.090e12"
"0__10.090e1__00" | "FLOAT_LITERAL" | "0__10.090e1__00"
"3.1415926" | "FLOAT_LITERAL" | "3.1415926"
"0.030" | "FLOAT_LITERAL" | "0.030"
"0.6" | "FLOAT_LITERAL" | "0.6"
".0f" | "FLOAT_LITERAL" | ".0f"
".0_000f" | "FLOAT_LITERAL" | ".0_000f"
".0___0990f" | "FLOAT_LITERAL" | ".0___0990f"
".000e0__0__0f" | "FLOAT_LITERAL" | ".000e0__0__0f"
"0__00.f" | "FLOAT_LITERAL" | "0__00.f"
"0__090.f" | "FLOAT_LITERAL" | "0__090.f"
"99__9.f" | "FLOAT_LITERAL" | "99__9.f"
"000.000f" | "FLOAT_LITERAL" | "000.000f"
"0__10.090f" | "FLOAT_LITERAL" | "0__10.090f"
"000__1_0.090f" | "FLOAT_LITERAL" | "000__1_0.090f"
"000__1_0.090e12f" | "FLOAT_LITERAL" | "000__1_0.090e12f"
"0__10.090e1__00f" | "FLOAT_LITERAL" | "0__10.090e1__00f"
"3.1415926f" | "FLOAT_LITERAL" | "3.1415926f"
"0.030f" | "FLOAT_LITERAL" | "0.030f"
"0.6f" | "FLOAT_LITERAL" | "0.6f"
}
```
2023-02-27 14:37:40 +08:00
回复了 Mr0C 创建的主题 程序员 一个连 git 的都不会用的前端能留吗?
@zycode277 哈哈
2023-02-23 13:31:40 +08:00
回复了 Shosuke 创建的主题 程序员 失业
@lihexinkai 怕是会更加空虚呢
2023-02-23 13:25:20 +08:00
回复了 echoless 创建的主题 程序员 感觉 golang 比 Java 还难读, 难学
说真的,看到这种满屏的 v, i, e 变量,就想吐🤮
2023-02-14 17:45:00 +08:00
回复了 lyhang 创建的主题 程序员 2023 新年新新新新气象-北京程序员交流群
@tfull 还有这种群?
2023-02-07 17:50:11 +08:00
回复了 zzpw 创建的主题 程序员 有没有适合实验室使用的机场推荐?
@israinbow 我也用的这个,感觉挺好。但是真的贵啊
2023-02-06 12:02:55 +08:00
回复了 chaleaochexist 创建的主题 程序员 RPC 和 http 相比优势在哪里?
我觉得问题是,gRPC 多大程度上使用了 HTTP2 。按理说,HTTP2 跟 HTTP1.1 都是在 TCP 之上的,也就是 TCP 层面的开销都是一样免不了,只是在应用层做了优化

个人觉得,gRPC 这种基于 HTTP2 的,应该在性能上是比不上那种直接基于 TCP 甚至 UDP 的 RPC
2023-02-06 11:48:37 +08:00
回复了 nosugar 创建的主题 程序员 发现销售岗位很多企业的招聘条件也是要求 35 岁以下
一方面搞 35 岁限制,一方面延迟退休。真是见了鬼了,那 35 岁到 65 岁这大半辈子喝西北风去啊
2023-02-02 10:32:34 +08:00
回复了 DigitalHarace 创建的主题 程序员 不会说话的人如何学习酒桌敬酒文化
@gongquanlin 我去,这里面弯弯绕这么多的吗
2023-02-02 10:30:34 +08:00
回复了 GalaxyVIP 创建的主题 程序员 裁员了,从移动端转后端,转吗?
奇怪,为啥都是移动端没人做,那么多 app 不需要人开发维护吗
1  2  3  4  5  6  7  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1736 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 30ms · UTC 16:31 · PVG 00:31 · LAX 08:31 · JFK 11:31
Developed with CodeLauncher
♥ Do have faith in what you're doing.