lawrancej / CompilerKit

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

Modify the constructor for CompilerKitAlternation #32

Closed lawrancej closed 12 years ago

lawrancej commented 12 years ago

If either the left or the right side of an alternation happens to be the EmptySet, then don't bother to allocate or return an alternation. Instead, return the other side.

  1. Modify compilerkit_alternation_new to return GObject *. Check if either the left or right are the emptyset, and if so, return the other side instead.
  2. Write a test case in src/alternation-test.c that verifies that compilerkit_alternation_new works as intended.
torosianj commented 12 years ago

I will work on this issue

lawrancej commented 12 years ago

Any progress on this? For a hint, take a look at the concatenation compilerkit_concatenation_new function. It's similar to what you'd need to do to close this issue.