本文介绍了c或c ++源代码中的逻辑解析树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要逻辑操作数的完整源代码解析树

!!!!用c ++或c#

谁能尽快帮助我。 ..?!

非常感谢我的朋友......

i need a full source code for logical operands parse tree
!!!!in c++ or c#
who help me as soon as he\she can...?!
thanks alot my friends...

推荐答案


Expr          = LogicOrExpr .
LogicOrExpr   = LogicAndExpr { '||' LogicAndExpr } .
LogicAndExpr  = LogicNotExpr { '&&' LogicNotExpr } .
LogicNotExpr  = { '!' } PrimaryExpr .
PrimaryExpr   = NestedExpr | NameExpr | LiteralExpr .
NestedExpr    = '(' Expr ')' .
NameExpr      = IDENTIFIER .
LiteralExpr   = 'true' | 'false' .





然后定义合适的类定义以保存上面的相应产品。



最后选择一个您选择的编译器 - 编译器工具并实现它。或者,您可以轻松地从给定的作品中编写一个自上而下的解析器。



干杯

Andi



Then define suitable class definition(s) to hold the respective productions above.

Finally take a Compiler-Compiler tool of your choice and implement it. Alternatively, you may easily write a top-down parser from the given productions.

Cheers
Andi


这篇关于c或c ++源代码中的逻辑解析树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 05:10