Ejemplo n.º 1
0
bool
KeyboardControl::OnCommand(unsigned id, unsigned code)
{
  if (id >= 0x20 && on_character != NULL) {
    on_character((TCHAR)id);
    return true;
  } else
    return ContainerWindow::OnCommand(id, code);
}
Ejemplo n.º 2
0
// character ::= ' c '
//
// TODO: Allow for unicode characters? Imrove error
// handling.
//
// FIXME: Move the diagnostics into the semantic
// action for character tokens. We might actually
// want to support multicharacter literals.
Token
Lexer::character()
{
  assert(peek() == '\'');
  get(); // '
  if (peek() == '\\') // consume an escape.
    get();
  get(); // c
  if (peek() != '\'')
    throw std::runtime_error("invalid character literal");
  get(); // '
  return on_character();
}
Ejemplo n.º 3
0
bool
CharacterButton::OnClicked()
{
  on_character(character);
  return true;
}