Parse rule implementation

This is a propose to: #279, after spend more work on refactors based on @luolong suggestions.