1/*---------------------------------------------------------------------------* 2 * SR_SemanticProcessorImpl.h * 3 * * 4 * Copyright 2007, 2008 Nuance Communciations, Inc. * 5 * * 6 * Licensed under the Apache License, Version 2.0 (the 'License'); * 7 * you may not use this file except in compliance with the License. * 8 * * 9 * You may obtain a copy of the License at * 10 * http://www.apache.org/licenses/LICENSE-2.0 * 11 * * 12 * Unless required by applicable law or agreed to in writing, software * 13 * distributed under the License is distributed on an 'AS IS' BASIS, * 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 15 * See the License for the specific language governing permissions and * 16 * limitations under the License. * 17 * * 18 *---------------------------------------------------------------------------*/ 19 20#ifndef __SR_SEMANTICPROCESSORIMPL_H 21#define __SR_SEMANTICPROCESSORIMPL_H 22 23 24 25#include "SR_SemanticGraph.h" 26#include "SR_SemanticProcessor.h" 27#include "SR_SemanticResult.h" 28#include "ESR_ReturnCode.h" 29 30 31/** 32 * eScript Semantic Processor stuff 33 */ 34#include "SR_ExpressionParser.h" 35#include "SR_ExpressionEvaluator.h" 36#include "SR_LexicalAnalyzer.h" 37#include "SR_SymbolTable.h" 38 39/** 40 * SR_SemanticProcessor implementation. 41 */ 42typedef struct SR_SemanticProcessorImpl_t 43{ 44 /** 45 * Interface functions that must be implemented. 46 */ 47 SR_SemanticProcessor Interface; 48 49 ExpressionParser* parser; 50 ExpressionEvaluator* eval; 51 SymbolTable* symtable; 52 LexicalAnalyzer* analyzer; 53 /* the accumulated scripts */ 54 LCHAR* acc_scripts; 55} 56SR_SemanticProcessorImpl; 57 58 59/** 60 * Default implementation. 61 */ 62SREC_SEMPROC_API ESR_ReturnCode SR_SemanticProcessor_Destroy(SR_SemanticProcessor* self); 63/** 64 * Default implementation. 65 */ 66SREC_SEMPROC_API ESR_ReturnCode SR_SemanticProcessor_CheckParse(SR_SemanticProcessor* self, SR_SemanticGraph* semgraph, const LCHAR* transcription, SR_SemanticResult** result, size_t* resultCount); 67/** 68 * Default implementation. 69 */ 70SREC_SEMPROC_API ESR_ReturnCode SR_SemanticProcessor_CheckParseByWordID(SR_SemanticProcessor* self, SR_SemanticGraph* semgraph, wordID* wordIDs, SR_SemanticResult** result, size_t* resultCount); 71/** 72 * Default implementation. 73 */ 74SREC_SEMPROC_API ESR_ReturnCode SR_SemanticProcessor_SetParam(SR_SemanticProcessor* self, const LCHAR* key, const LCHAR* value); 75/** 76 * Default implementation. 77 */ 78SREC_SEMPROC_API ESR_ReturnCode SR_SemanticProcessor_Flush(SR_SemanticProcessor* self); 79/** 80 * Default implementation. 81 */ 82SREC_SEMPROC_API PINLINE ESR_BOOL isnum(const LCHAR* str); 83 84 85 86 87#endif /* __SR_SEMANTICPROCESSORIMPL_H */ 88