擅长:python、mysql、java
<p>你自己分析这个数字。在</p>
<p>递归下降解析器对于这种输入非常容易。
首先写一个语法:</p>
<pre><code>float ::= ipart ('.' fpart)* ('e' exp)*
ipart ::= digit+
fpart ::= digit+
exp ::= ('+'|'-') digit+
digit = ['0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9']
</code></pre>
<p>现在把这个语法转换成函数应该很简单。。。在</p>