Skip to content

Command Line Parser

Choose a tag to compare

@stephen-hqxu stephen-hqxu released this 12 Feb 14:35
3cc7af4

Release 0.16.2

STPCommandLineParser (#51)

This release brings a flexible command line parser framework that allows application to define how to read command line inputs and convert those into specific type then stored to variables.

Obviously this will be nowhere as good as the existing mature command line parsers out there in the open source community, but it suffices for our application, and for fun.

Key features:

  • Standard Unix-like command line syntax
  • Configurable
  • Positional argument
  • Variable binding to option
  • Group and subcommand
  • Pre/Post validation
  • Help message printer

STPDemo

  • Add command line options to the demo application. Run -h to get the help message for more detail.
  • Split STPMasterRenderer from STPStart.cpp because it takes too long to compile this large file.
  • Fix a bug at the start of the demo program for not setting the viewport size along with the window size.
  • Now support full screen mode.

General fixes and improvements

  • Bump license date.
  • Change some exceptions from syntax error to semantics error in TDL parser.
  • Simplify test assertions with the new library features.
  • Fix STPTestNearestNeighbour for forgetting to check the return value of a test function.

STPLexer

  • Allow caching lexical state index to avoid repetitive calculation.
  • Now lexical state can also be assigned by the lexical state object rather than its ID only.
  • Fix a lexer error when the last few tokens in the input are taking discard action. Now the lexer checks if the remaining string is empty every loop cycle.
  • Allow configuring the lexer by supplying a lexical behaviour structure as an constructor argument.
  • Make all members in STPToken mutable so it can be copy assigned properly.