Tuesday 16 November 2010

Sexagesimal handling – R97

At last some real programming (again), although frustratingly slow (revision 97). In general I wish everything accomplished immediatelly!! I enabled some correct sexagesimal constant scanning allowing mkmap map programs to specify float constants as sexagesimals, f.ex.:
  • 23ʰ12ᵐ03.14ˢ (a right ascension)
  • 23ʰ12.17ᵐ (another)
  • 48°34'16.07" (a declination without a sign)
  • 33° (another)
The acceptable sequence of the sexagesimal markers are ʰᵐˢ, ʰᵐ, ʰ, °'", °' and °. All other sexagesimal marker sequences within a floating point literal constant are illegal. The code is also prepared for hexadecimal and octal constants, but correct scanning of those are not yet implemented.

CAVEAT 1: The scanner doesn't create a floating point value from the scanned token – that's up to the parser. A token "method" for creating a floating point value is to be added in the future.

CAVEAT 2: The scanner is not screaming (fprintf stderr) from the occurrence of erroneous sexagesimal tokens, the screaming philosophy is not yet determined.

No comments: