将txt文件转换为c中的工作命令集 [英] converting txt file into working command set in c
问题描述
大家好。
我正在尝试构建可通过使用C ++制作的GUI进行编程的PLC
我有一个想法,即使用GUI i'' ll创建一个txt文件将包含用户希望plc将以这种方式执行的命令的解析,用户可以使用多个命令集并存储它们以备将来使用
我希望你能理解我想说的话
我的问题是如何写一个C程序将转换为txt文件为命令,现在我可以转移到芯片
我需要做什么或在哪里可以阅读有关这些类型的程序?
谢谢你的帮助
Matan F
示例
txt - >
1)inputX outputY DO func(W)
2)inputX2 outputY outputYi ... Func(W2)
3)等。 。
。
。
。
将txt转换为C的代码嵌入式 - >你认为什么需要去这里
ps。我有一个想法用xml代替txt
如果有帮助
Hello everyone
I''m trying to build PLC that can be programmed through using GUI made in C++
I had an idea that using the GUI i''ll create a txt file will contain a parsing of the commands that the user wants that the plc will do
in such manner the user can use multiple commands set and also store them for future use
I hope you manage to understand what i''m trying to say
My problem is how to write a C program that will convert to txt file into commands that now i can transfer into the chip
what do i need to do or where can i read about those types of programs?
thank you for your help
Matan F
example
txt-->
1)inputX outputY DO func(W)
2)inputX2 outputY outputYi ... Func(W2)
3)etc...
.
.
.
code to convert txt to C embedded --> what do you think need to go here
ps. i had an idea to do it with xml instead of txt
if it helps
推荐答案
你需要编写(或实现)一种语言解析器,将用户输入转换为目标命令。请查看 http://www.antlr.org/ [ ^ ]以获取一些信息。
You need to write (or implement) a language parser, that will convert the user input into your target commands. Take a look at http://www.antlr.org/[^] for some information.
这篇关于将txt文件转换为c中的工作命令集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!