coc/r学习笔记-调用与安装

本文介绍如何使用 Coco/R 工具为 C#、C++ 和 Java 生成词法分析器和语法分析器。文章详细说明了所需文件的复制步骤及命令行调用方法,并提供了设置命名空间或包名的选项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

C# and C++ version. Copy the following files to a new directory:
Coco.exe the executable
Scanner.frame the frame file from which the scanner is generated
Parser.frame the frame file from which the parser is generated
Java version. Copy the following files to a new directory:
Coco.jar an archive containing all classes of Coco/R
Scanner.frame the frame file from which the scanner is generated
Parser frame the frame file from which the parser is generated
3.2 Invocation
Coco/R can be invoked from the command line as follows:
C# or C++: Coco fileName [Options]
Java: java -jar Coco.jar fileName [Options]
fileName is the name of the file containing the Cocol/R compiler description. As a
convention, compiler descriptions have the extension .ATG (for attributed grammar).
Options. The following options may be specified:
Options =
{ "-namespace" namespaceName /* in Java: "-package" packageName */
| "-frames" framesDirectory
| "-trace" traceString
}.
The user can specify a namespace (or package) to which the generated scanner and
parser should belong (e.g. at.jku.ssw.Coco). If no namespace is specified the
generated classes belong to the default namespace. In the C++ version, the namespace
name must be a simple identifier (e.g. MyProject).
The -frames option can be used to specify the dire

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值