comment

Action executed in 0.000

Terminology

tags:
On the matter of expressions, terms, and factors, here's a grammar in near-BNF. It may or may not help you.

expression -> term [+- term]?

term -> factor [*/ factor]?

factor -> number | '(' expression ')'

( 2 ) + 3 * 5 has 3 numbers, 4 factors, 3 terms, and 2 expressions. I'll try to draw a tree.

    e
  t   t
 f   f f
e    # #
t    3 5
f
#
2
parent post: Stack, Expression Evaluation Challenge
notify me: yes

Comments

none yet

Post a Comment

* indicates a required field
anonymous (If you want to identify yourself, please sign in first.)
required This field is required.

Max size is 2 MB, aspect ratio 3:4 width:height
required This field is required.
Please include a short description.
required This field is required.

480 characters remaining.
is public

(Use this field if you have to. 3000 characters remaining.)
2 dimes, 2 quarters, 2 pennies + 100

Trackback URL

http://derocher.org/~brian//trackback.php?ParentId=589

form