Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Side by Side Diff: forth/ForthParser.h

Issue 1559823002: remove forth experiment (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « forth/Forth.cpp ('k') | forth/ForthTests.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 /*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8 #ifndef ForthParser_DEFINED
9 #define ForthParser_DEFINED
10
11 #include "SkTDict.h"
12 //#include "SkString.h"
13
14 class ForthWord;
15 class FCode;
16
17 class ForthParser {
18 public:
19 ForthParser();
20 ~ForthParser();
21
22 const char* parse(const char text[], FCode*);
23
24 void addWord(const char name[], ForthWord* word) {
25 this->add(name, strlen(name), word);
26 }
27
28 void add(const char name[], size_t len, ForthWord* word) {
29 // SkString str(name, len);
30 // SkDebugf("add %s %p\n", str.c_str(), word);
31 SkDEBUGCODE(bool isNewWord = )fDict.set(name, len, word);
32 SkASSERT(isNewWord);
33 }
34
35 ForthWord* find(const char name[], size_t len) const {
36 ForthWord* word;
37 return fDict.find(name, len, &word) ? word : NULL;
38 }
39
40 private:
41 void addStdWords();
42
43 SkTDict<ForthWord*> fDict;
44 };
45
46 #endif
OLDNEW
« no previous file with comments | « forth/Forth.cpp ('k') | forth/ForthTests.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698