/MathLang

LL(1) grammar math parser (lab project)

Primary LanguageC#

MathLang

LL(1) grammar math parser (lab project) ##Code Example

fnc g(x,y)=x^y
fnc f(x) = x^2*pi+g(x,2)
print f(pi+1)
print cos(pi/4)
print "sqrt = ",sqrt(2)/2," hello?"
fnc h(x) = cos(x)^2+sin(x)^2 
print "cos(5)^2+sin(5)^2 = ", h(5)
print "cos(1.9)^2+sin(1.9)^2 = ", h(1.9)
print "e^1 = ", e^1
print abs((-g(2,3))^2)
fnc t(x) = e^ln(x)
print t(9)