/* * [MASMCharCategory.java] * * Summary: Top level enum to define the categories of character for the MASM parser. * * Copyright: (c) 2011-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2011-01-02 initial version. */ package com.mindprod.masmtidy; /** * Top level enum to define the categories of character for the MASM parser. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2011-01-02 initial version. * @since 2011-01-02 */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) public enum MASMCharCategory { /** * End of line character */ EOL, /** * cr */ IGNORE, /** * letters, digits, punctuation, control chars */ PLAIN, /** * " */ QUOTE, /** * ; introduces a comment */ SEMICOLON, /** * whitespace */ SPACE, /** * ' */ TICK; /** * Categorise one character * * @param theChar character to categorise * * @return category code, e.g. PLAIN QUOTE */ static MASMCharCategory categorise( char theChar ) { switch ( theChar ) { case ' ': case '\t': case 0xa0://   return SPACE; case '\n': return EOL; case '\r': case 127: return IGNORE; case '\"': return QUOTE; case '\'': return TICK; case ';': return SEMICOLON; default: return PLAIN; } } }