lawrancej / CompilerKit

Compiler construction library in C.
GNU Lesser General Public License v2.1
55 stars 33 forks source link

Modify the constructor for CompilerKitKleeneStar #38

Closed lawrancej closed 12 years ago

lawrancej commented 12 years ago

In Kleene star a*, if a is the empty string, we don't need kleene star. Likewise, if a is the emptyset, we don't need kleene star either.

  1. In compilerkit_kleene_star_new, change the return type to GObject *.
  2. Update the constructor (compilerkit_kleene_star_new) so that if the node is either the emptystring or the emptyset, return just the emptystring or emptyset, respectively.
  3. Write a test in tests/kleene-star-test.c that verifies the constructor works as specified.
AllTheAction commented 12 years ago

Dibs on this action

lawrancej commented 12 years ago

Looks good to me. Closing this issue.