ANTLR (ANother Tool for Language Recognition)是一项开源的java编写的语法/词法分析器套件.
通过ANTLR可以生成语法处理器来对进行文本或二进制文件进行解析处理.
ANTLR由定义语法,编译工具和运行时库组成.
| package main | |
| import ( | |
| "net/http" | |
| "os" | |
| "path/filepath" | |
| "log" | |
| ) | |
| func main() { |
| import org.junit.jupiter.api.Test; | |
| import org.openjdk.jmh.annotations.*; | |
| import org.openjdk.jmh.infra.Blackhole; | |
| import org.openjdk.jmh.runner.Runner; | |
| import org.openjdk.jmh.runner.options.Options; | |
| import org.openjdk.jmh.runner.options.OptionsBuilder; | |
| import org.openjdk.jmh.runner.options.TimeValue; | |
| import java.util.Optional; | |
| import java.util.concurrent.TimeUnit; |
| rm -rf .idea/ && find . -name "*.iml" -type f -delete |
| package tester; | |
| import io.protostuff.LinkedBuffer; | |
| import io.protostuff.ProtostuffIOUtil; | |
| import io.protostuff.Schema; | |
| import io.protostuff.runtime.DefaultIdStrategy; | |
| import io.protostuff.runtime.IdStrategy; | |
| import io.protostuff.runtime.RuntimeSchema; | |
| import lombok.SneakyThrows; | |
| import lombok.ToString; |
script or command to start :
#!/bin/sh
docker run --rm \
-a STDIN -a STDOUT -a STDERR \| public interface ClassSerialize{ | |
| static String classToString(Class cls) { | |
| return cls.getName() | |
| .replaceFirst("class ", "") | |
| .replaceFirst("interface ", ""); | |
| } | |
| @SneakyThrows | |
| static Class stringToClass(String cls) { | |
| if (cls.contains("$")) { |