| * Copyright 2011 Google Inc. |
| * Use of this source code is governed by a BSD-style license that can be |
| * found in the LICENSE file. |
| #ifndef ForthParser_DEFINED |
| #define ForthParser_DEFINED |
| const char* parse(const char text[], FCode*); |
| void addWord(const char name[], ForthWord* word) { |
| this->add(name, strlen(name), word); |
| void add(const char name[], size_t len, ForthWord* word) { |
| // SkString str(name, len); |
| // SkDebugf("add %s %p\n", str.c_str(), word); |
| SkDEBUGCODE(bool isNewWord = )fDict.set(name, len, word); |
| ForthWord* find(const char name[], size_t len) const { |
| return fDict.find(name, len, &word) ? word : NULL; |
| SkTDict<ForthWord*> fDict; |