implemented string stack to store the matched variable-pattern from flex