X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoard%2FSimanticsDataParser.h;h=5dc6d736eba3a8006f7ba667ee98a23851ea0f46;hb=2e8ccfd78bbe27e0b999d53eb261f81d3ad86fef;hp=0d1785fc774555511f3b43bae1b74e75daf033ee;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/SimanticsDataParser.h b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/SimanticsDataParser.h index 0d1785fc7..5dc6d736e 100644 --- a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/SimanticsDataParser.h +++ b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/SimanticsDataParser.h @@ -1,576 +1,576 @@ -/** \file - * This C header file was generated by $ANTLR version 3.2 Sep 23, 2009 12:02:23 - * - * - From the grammar source file : C:\\Simantics\\workspace\\org.simantics.databoard\\cpp\\DataBoardTest\\DataBoard\\SimanticsData.g - * - On : 2010-03-26 13:33:27 - * - for the parser : SimanticsDataParserParser * - * Editing it, at least manually, is not wise. - * - * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws. - * - * - * The parser SimanticsDataParser has the callable functions (rules) shown below, - * which will invoke the code for the associated rule in the source grammar - * assuming that the input stream is pointing to a token/text stream that could begin - * this rule. - * - * For instance if you call the first (topmost) rule in a parser grammar, you will - * get the results of a full parse, but calling a rule half way through the grammar will - * allow you to pass part of a full token stream to the parser, such as for syntax checking - * in editors and so on. - * - * The parser entry points are called indirectly (by function pointer to function) via - * a parser context typedef pSimanticsDataParser, which is returned from a call to SimanticsDataParserNew(). - * - * The methods in pSimanticsDataParser are as follows: - * - * - SimanticsDataParser_typeDefinitions_return pSimanticsDataParser->typeDefinitions(pSimanticsDataParser) - * - SimanticsDataParser_typeDefinition_return pSimanticsDataParser->typeDefinition(pSimanticsDataParser) - * - SimanticsDataParser_unionType_return pSimanticsDataParser->unionType(pSimanticsDataParser) - * - SimanticsDataParser_unionComponent_return pSimanticsDataParser->unionComponent(pSimanticsDataParser) - * - SimanticsDataParser_type_return pSimanticsDataParser->type(pSimanticsDataParser) - * - SimanticsDataParser_arrayLength_return pSimanticsDataParser->arrayLength(pSimanticsDataParser) - * - SimanticsDataParser_basicType_return pSimanticsDataParser->basicType(pSimanticsDataParser) - * - SimanticsDataParser_tupleType_return pSimanticsDataParser->tupleType(pSimanticsDataParser) - * - SimanticsDataParser_recordType_return pSimanticsDataParser->recordType(pSimanticsDataParser) - * - SimanticsDataParser_component_return pSimanticsDataParser->component(pSimanticsDataParser) - * - SimanticsDataParser_typeReference_return pSimanticsDataParser->typeReference(pSimanticsDataParser) - * - SimanticsDataParser_parameter_return pSimanticsDataParser->parameter(pSimanticsDataParser) - * - SimanticsDataParser_parameterValue_return pSimanticsDataParser->parameterValue(pSimanticsDataParser) - * - SimanticsDataParser_range_return pSimanticsDataParser->range(pSimanticsDataParser) - * - SimanticsDataParser_number_return pSimanticsDataParser->number(pSimanticsDataParser) - * - SimanticsDataParser_string_return pSimanticsDataParser->string(pSimanticsDataParser) - * - SimanticsDataParser_boolean_return pSimanticsDataParser->boolean(pSimanticsDataParser) - * - SimanticsDataParser_valueDefinitions_return pSimanticsDataParser->valueDefinitions(pSimanticsDataParser) - * - SimanticsDataParser_valueDefinition_return pSimanticsDataParser->valueDefinition(pSimanticsDataParser) - * - SimanticsDataParser_value_return pSimanticsDataParser->value(pSimanticsDataParser) - * - SimanticsDataParser_basicValue_return pSimanticsDataParser->basicValue(pSimanticsDataParser) - * - SimanticsDataParser_array_return pSimanticsDataParser->array(pSimanticsDataParser) - * - SimanticsDataParser_tuple_return pSimanticsDataParser->tuple(pSimanticsDataParser) - * - SimanticsDataParser_taggedValue_return pSimanticsDataParser->taggedValue(pSimanticsDataParser) - * - SimanticsDataParser_record_return pSimanticsDataParser->record(pSimanticsDataParser) - * - SimanticsDataParser_recordAssignment_return pSimanticsDataParser->recordAssignment(pSimanticsDataParser) - * - SimanticsDataParser_map_return pSimanticsDataParser->map(pSimanticsDataParser) - * - SimanticsDataParser_mapAssignment_return pSimanticsDataParser->mapAssignment(pSimanticsDataParser) - * - * The return type for any particular rule is of course determined by the source - * grammar file. - */ -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef _SimanticsDataParser_H -#define _SimanticsDataParser_H -/* ============================================================================= - * Standard antlr3 C runtime definitions - */ -#include - -/* End of standard antlr 3 runtime definitions - * ============================================================================= - */ - -#ifdef __cplusplus -extern "C" { -#endif - -// Forward declare the context typedef so that we can use it before it is -// properly defined. Delegators and delegates (from import statements) are -// interdependent and their context structures contain pointers to each other -// C only allows such things to be declared if you pre-declare the typedef. -// -typedef struct SimanticsDataParser_Ctx_struct SimanticsDataParser, * pSimanticsDataParser; - - - -#ifdef ANTLR3_WINDOWS -// Disable: Unreferenced parameter, - Rules with parameters that are not used -// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually) -// initialized but unused variable - tree rewrite variables declared but not needed -// Unreferenced local variable - lexer rule declares but does not always use _type -// potentially unitialized variable used - retval always returned from a rule -// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns -// -// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at -// and the codegen must generate some of these warnings by necessity, apart from 4100, which is -// usually generated when a parser rule is given a parameter that it does not use. Mostly though -// this is a matter of orthogonality hence I disable that one. -// -#pragma warning( disable : 4100 ) -#pragma warning( disable : 4101 ) -#pragma warning( disable : 4127 ) -#pragma warning( disable : 4189 ) -#pragma warning( disable : 4505 ) -#pragma warning( disable : 4701 ) -#endif -typedef struct SimanticsDataParser_typeDefinitions_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_typeDefinitions_return; - -typedef struct SimanticsDataParser_typeDefinition_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_typeDefinition_return; - -typedef struct SimanticsDataParser_unionType_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_unionType_return; - -typedef struct SimanticsDataParser_unionComponent_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_unionComponent_return; - -typedef struct SimanticsDataParser_type_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_type_return; - -typedef struct SimanticsDataParser_arrayLength_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_arrayLength_return; - -typedef struct SimanticsDataParser_basicType_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_basicType_return; - -typedef struct SimanticsDataParser_tupleType_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_tupleType_return; - -typedef struct SimanticsDataParser_recordType_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_recordType_return; - -typedef struct SimanticsDataParser_component_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_component_return; - -typedef struct SimanticsDataParser_typeReference_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_typeReference_return; - -typedef struct SimanticsDataParser_parameter_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_parameter_return; - -typedef struct SimanticsDataParser_parameterValue_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_parameterValue_return; - -typedef struct SimanticsDataParser_range_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_range_return; - -typedef struct SimanticsDataParser_number_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_number_return; - -typedef struct SimanticsDataParser_string_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_string_return; - -typedef struct SimanticsDataParser_boolean_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_boolean_return; - -typedef struct SimanticsDataParser_valueDefinitions_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_valueDefinitions_return; - -typedef struct SimanticsDataParser_valueDefinition_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_valueDefinition_return; - -typedef struct SimanticsDataParser_value_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_value_return; - -typedef struct SimanticsDataParser_basicValue_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_basicValue_return; - -typedef struct SimanticsDataParser_array_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_array_return; - -typedef struct SimanticsDataParser_tuple_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_tuple_return; - -typedef struct SimanticsDataParser_taggedValue_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_taggedValue_return; - -typedef struct SimanticsDataParser_record_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_record_return; - -typedef struct SimanticsDataParser_recordAssignment_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_recordAssignment_return; - -typedef struct SimanticsDataParser_map_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_map_return; - -typedef struct SimanticsDataParser_mapAssignment_return_struct -{ - /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees - */ - pANTLR3_COMMON_TOKEN start; - pANTLR3_COMMON_TOKEN stop; - pANTLR3_BASE_TREE tree; - -} - SimanticsDataParser_mapAssignment_return; - - - -/** Context tracking structure for SimanticsDataParser - */ -struct SimanticsDataParser_Ctx_struct -{ - /** Built in ANTLR3 context tracker contains all the generic elements - * required for context tracking. - */ - pANTLR3_PARSER pParser; - - - SimanticsDataParser_typeDefinitions_return (*typeDefinitions) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_typeDefinition_return (*typeDefinition) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_unionType_return (*unionType) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_unionComponent_return (*unionComponent) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_type_return (*type) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_arrayLength_return (*arrayLength) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_basicType_return (*basicType) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_tupleType_return (*tupleType) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_recordType_return (*recordType) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_component_return (*component) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_typeReference_return (*typeReference) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_parameter_return (*parameter) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_parameterValue_return (*parameterValue) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_range_return (*range) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_number_return (*number) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_string_return (*string) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_boolean_return (*boolean) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_valueDefinitions_return (*valueDefinitions) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_valueDefinition_return (*valueDefinition) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_value_return (*value) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_basicValue_return (*basicValue) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_array_return (*array) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_tuple_return (*tuple) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_taggedValue_return (*taggedValue) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_record_return (*record) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_recordAssignment_return (*recordAssignment) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_map_return (*map) (struct SimanticsDataParser_Ctx_struct * ctx); - SimanticsDataParser_mapAssignment_return (*mapAssignment) (struct SimanticsDataParser_Ctx_struct * ctx); - // Delegated rules - const char * (*getGrammarFileName)(); - void (*free) (struct SimanticsDataParser_Ctx_struct * ctx); - /* @headerFile.members() */ - pANTLR3_BASE_TREE_ADAPTOR adaptor; - pANTLR3_VECTOR_FACTORY vectors; - /* End @headerFile.members() */ -}; - -// Function protoypes for the constructor functions that external translation units -// such as delegators and delegates may wish to call. -// -ANTLR3_API pSimanticsDataParser SimanticsDataParserNew (pANTLR3_COMMON_TOKEN_STREAM instream); -ANTLR3_API pSimanticsDataParser SimanticsDataParserNewSSD (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state); - -/** Symbolic definitions of all the tokens that the parser will work with. - * \{ - * - * Antlr will define EOF, but we can't use that as it it is too common in - * in C header files and that would be confusing. There is no way to filter this out at the moment - * so we just undef it here for now. That isn't the value we get back from C recognizers - * anyway. We are looking for ANTLR3_TOKEN_EOF. - */ -#ifdef EOF -#undef EOF -#endif -#ifdef Tokens -#undef Tokens -#endif -#define RECORD_TYPE 7 -#define EXPONENT 25 -#define TUPLE_TYPE 8 -#define VALUE_DEFINITION 14 -#define OCTAL_ESC 33 -#define ARRAY_TYPE 9 -#define FLOAT 26 -#define ID 23 -#define EOF -1 -#define TUPLE 18 -#define ESC_SEQ 29 -#define UNION_TYPE 6 -#define TYPE_REFERENCE 10 -#define TYPE_COMPONENT 12 -#define COMMENT 27 -#define TYPE_ANNOTATION 11 -#define ARRAY 17 -#define T__42 42 -#define T__43 43 -#define T__40 40 -#define T__41 41 -#define RECORD 20 -#define T__46 46 -#define T__47 47 -#define T__44 44 -#define T__45 45 -#define TAGGED_VALUE 19 -#define T__48 48 -#define T__49 49 -#define VALUE_DEFINITIONS 13 -#define UNICODE_ESC 32 -#define HEX_DIGIT 31 -#define INT 24 -#define VARIANT 16 -#define WS 28 -#define T__34 34 -#define TYPE_DEFINITIONS 4 -#define T__35 35 -#define T__36 36 -#define T__37 37 -#define T__38 38 -#define T__39 39 -#define MAP 21 -#define TYPE_DEFINITION 5 -#define ASSIGNMENT 22 -#define NO_VALUE 15 -#define STRING 30 -#ifdef EOF -#undef EOF -#define EOF ANTLR3_TOKEN_EOF -#endif - -#ifndef TOKENSOURCE -#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource -#endif - -/* End of token definitions for SimanticsDataParser - * ============================================================================= - */ -/** \} */ - -#ifdef __cplusplus -} -#endif - -#endif - -/* END - Note:Keep extra line feed to satisfy UNIX systems */ +/** \file + * This C header file was generated by $ANTLR version 3.2 Sep 23, 2009 12:02:23 + * + * - From the grammar source file : C:\\Simantics\\workspace\\org.simantics.databoard\\cpp\\DataBoardTest\\DataBoard\\SimanticsData.g + * - On : 2010-03-26 13:33:27 + * - for the parser : SimanticsDataParserParser * + * Editing it, at least manually, is not wise. + * + * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws. + * + * + * The parser SimanticsDataParser has the callable functions (rules) shown below, + * which will invoke the code for the associated rule in the source grammar + * assuming that the input stream is pointing to a token/text stream that could begin + * this rule. + * + * For instance if you call the first (topmost) rule in a parser grammar, you will + * get the results of a full parse, but calling a rule half way through the grammar will + * allow you to pass part of a full token stream to the parser, such as for syntax checking + * in editors and so on. + * + * The parser entry points are called indirectly (by function pointer to function) via + * a parser context typedef pSimanticsDataParser, which is returned from a call to SimanticsDataParserNew(). + * + * The methods in pSimanticsDataParser are as follows: + * + * - SimanticsDataParser_typeDefinitions_return pSimanticsDataParser->typeDefinitions(pSimanticsDataParser) + * - SimanticsDataParser_typeDefinition_return pSimanticsDataParser->typeDefinition(pSimanticsDataParser) + * - SimanticsDataParser_unionType_return pSimanticsDataParser->unionType(pSimanticsDataParser) + * - SimanticsDataParser_unionComponent_return pSimanticsDataParser->unionComponent(pSimanticsDataParser) + * - SimanticsDataParser_type_return pSimanticsDataParser->type(pSimanticsDataParser) + * - SimanticsDataParser_arrayLength_return pSimanticsDataParser->arrayLength(pSimanticsDataParser) + * - SimanticsDataParser_basicType_return pSimanticsDataParser->basicType(pSimanticsDataParser) + * - SimanticsDataParser_tupleType_return pSimanticsDataParser->tupleType(pSimanticsDataParser) + * - SimanticsDataParser_recordType_return pSimanticsDataParser->recordType(pSimanticsDataParser) + * - SimanticsDataParser_component_return pSimanticsDataParser->component(pSimanticsDataParser) + * - SimanticsDataParser_typeReference_return pSimanticsDataParser->typeReference(pSimanticsDataParser) + * - SimanticsDataParser_parameter_return pSimanticsDataParser->parameter(pSimanticsDataParser) + * - SimanticsDataParser_parameterValue_return pSimanticsDataParser->parameterValue(pSimanticsDataParser) + * - SimanticsDataParser_range_return pSimanticsDataParser->range(pSimanticsDataParser) + * - SimanticsDataParser_number_return pSimanticsDataParser->number(pSimanticsDataParser) + * - SimanticsDataParser_string_return pSimanticsDataParser->string(pSimanticsDataParser) + * - SimanticsDataParser_boolean_return pSimanticsDataParser->boolean(pSimanticsDataParser) + * - SimanticsDataParser_valueDefinitions_return pSimanticsDataParser->valueDefinitions(pSimanticsDataParser) + * - SimanticsDataParser_valueDefinition_return pSimanticsDataParser->valueDefinition(pSimanticsDataParser) + * - SimanticsDataParser_value_return pSimanticsDataParser->value(pSimanticsDataParser) + * - SimanticsDataParser_basicValue_return pSimanticsDataParser->basicValue(pSimanticsDataParser) + * - SimanticsDataParser_array_return pSimanticsDataParser->array(pSimanticsDataParser) + * - SimanticsDataParser_tuple_return pSimanticsDataParser->tuple(pSimanticsDataParser) + * - SimanticsDataParser_taggedValue_return pSimanticsDataParser->taggedValue(pSimanticsDataParser) + * - SimanticsDataParser_record_return pSimanticsDataParser->record(pSimanticsDataParser) + * - SimanticsDataParser_recordAssignment_return pSimanticsDataParser->recordAssignment(pSimanticsDataParser) + * - SimanticsDataParser_map_return pSimanticsDataParser->map(pSimanticsDataParser) + * - SimanticsDataParser_mapAssignment_return pSimanticsDataParser->mapAssignment(pSimanticsDataParser) + * + * The return type for any particular rule is of course determined by the source + * grammar file. + */ +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef _SimanticsDataParser_H +#define _SimanticsDataParser_H +/* ============================================================================= + * Standard antlr3 C runtime definitions + */ +#include + +/* End of standard antlr 3 runtime definitions + * ============================================================================= + */ + +#ifdef __cplusplus +extern "C" { +#endif + +// Forward declare the context typedef so that we can use it before it is +// properly defined. Delegators and delegates (from import statements) are +// interdependent and their context structures contain pointers to each other +// C only allows such things to be declared if you pre-declare the typedef. +// +typedef struct SimanticsDataParser_Ctx_struct SimanticsDataParser, * pSimanticsDataParser; + + + +#ifdef ANTLR3_WINDOWS +// Disable: Unreferenced parameter, - Rules with parameters that are not used +// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually) +// initialized but unused variable - tree rewrite variables declared but not needed +// Unreferenced local variable - lexer rule declares but does not always use _type +// potentially unitialized variable used - retval always returned from a rule +// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns +// +// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at +// and the codegen must generate some of these warnings by necessity, apart from 4100, which is +// usually generated when a parser rule is given a parameter that it does not use. Mostly though +// this is a matter of orthogonality hence I disable that one. +// +#pragma warning( disable : 4100 ) +#pragma warning( disable : 4101 ) +#pragma warning( disable : 4127 ) +#pragma warning( disable : 4189 ) +#pragma warning( disable : 4505 ) +#pragma warning( disable : 4701 ) +#endif +typedef struct SimanticsDataParser_typeDefinitions_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_typeDefinitions_return; + +typedef struct SimanticsDataParser_typeDefinition_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_typeDefinition_return; + +typedef struct SimanticsDataParser_unionType_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_unionType_return; + +typedef struct SimanticsDataParser_unionComponent_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_unionComponent_return; + +typedef struct SimanticsDataParser_type_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_type_return; + +typedef struct SimanticsDataParser_arrayLength_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_arrayLength_return; + +typedef struct SimanticsDataParser_basicType_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_basicType_return; + +typedef struct SimanticsDataParser_tupleType_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_tupleType_return; + +typedef struct SimanticsDataParser_recordType_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_recordType_return; + +typedef struct SimanticsDataParser_component_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_component_return; + +typedef struct SimanticsDataParser_typeReference_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_typeReference_return; + +typedef struct SimanticsDataParser_parameter_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_parameter_return; + +typedef struct SimanticsDataParser_parameterValue_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_parameterValue_return; + +typedef struct SimanticsDataParser_range_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_range_return; + +typedef struct SimanticsDataParser_number_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_number_return; + +typedef struct SimanticsDataParser_string_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_string_return; + +typedef struct SimanticsDataParser_boolean_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_boolean_return; + +typedef struct SimanticsDataParser_valueDefinitions_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_valueDefinitions_return; + +typedef struct SimanticsDataParser_valueDefinition_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_valueDefinition_return; + +typedef struct SimanticsDataParser_value_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_value_return; + +typedef struct SimanticsDataParser_basicValue_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_basicValue_return; + +typedef struct SimanticsDataParser_array_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_array_return; + +typedef struct SimanticsDataParser_tuple_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_tuple_return; + +typedef struct SimanticsDataParser_taggedValue_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_taggedValue_return; + +typedef struct SimanticsDataParser_record_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_record_return; + +typedef struct SimanticsDataParser_recordAssignment_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_recordAssignment_return; + +typedef struct SimanticsDataParser_map_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_map_return; + +typedef struct SimanticsDataParser_mapAssignment_return_struct +{ + /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees + */ + pANTLR3_COMMON_TOKEN start; + pANTLR3_COMMON_TOKEN stop; + pANTLR3_BASE_TREE tree; + +} + SimanticsDataParser_mapAssignment_return; + + + +/** Context tracking structure for SimanticsDataParser + */ +struct SimanticsDataParser_Ctx_struct +{ + /** Built in ANTLR3 context tracker contains all the generic elements + * required for context tracking. + */ + pANTLR3_PARSER pParser; + + + SimanticsDataParser_typeDefinitions_return (*typeDefinitions) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_typeDefinition_return (*typeDefinition) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_unionType_return (*unionType) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_unionComponent_return (*unionComponent) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_type_return (*type) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_arrayLength_return (*arrayLength) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_basicType_return (*basicType) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_tupleType_return (*tupleType) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_recordType_return (*recordType) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_component_return (*component) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_typeReference_return (*typeReference) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_parameter_return (*parameter) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_parameterValue_return (*parameterValue) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_range_return (*range) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_number_return (*number) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_string_return (*string) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_boolean_return (*boolean) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_valueDefinitions_return (*valueDefinitions) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_valueDefinition_return (*valueDefinition) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_value_return (*value) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_basicValue_return (*basicValue) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_array_return (*array) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_tuple_return (*tuple) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_taggedValue_return (*taggedValue) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_record_return (*record) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_recordAssignment_return (*recordAssignment) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_map_return (*map) (struct SimanticsDataParser_Ctx_struct * ctx); + SimanticsDataParser_mapAssignment_return (*mapAssignment) (struct SimanticsDataParser_Ctx_struct * ctx); + // Delegated rules + const char * (*getGrammarFileName)(); + void (*free) (struct SimanticsDataParser_Ctx_struct * ctx); + /* @headerFile.members() */ + pANTLR3_BASE_TREE_ADAPTOR adaptor; + pANTLR3_VECTOR_FACTORY vectors; + /* End @headerFile.members() */ +}; + +// Function protoypes for the constructor functions that external translation units +// such as delegators and delegates may wish to call. +// +ANTLR3_API pSimanticsDataParser SimanticsDataParserNew (pANTLR3_COMMON_TOKEN_STREAM instream); +ANTLR3_API pSimanticsDataParser SimanticsDataParserNewSSD (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state); + +/** Symbolic definitions of all the tokens that the parser will work with. + * \{ + * + * Antlr will define EOF, but we can't use that as it it is too common in + * in C header files and that would be confusing. There is no way to filter this out at the moment + * so we just undef it here for now. That isn't the value we get back from C recognizers + * anyway. We are looking for ANTLR3_TOKEN_EOF. + */ +#ifdef EOF +#undef EOF +#endif +#ifdef Tokens +#undef Tokens +#endif +#define RECORD_TYPE 7 +#define EXPONENT 25 +#define TUPLE_TYPE 8 +#define VALUE_DEFINITION 14 +#define OCTAL_ESC 33 +#define ARRAY_TYPE 9 +#define FLOAT 26 +#define ID 23 +#define EOF -1 +#define TUPLE 18 +#define ESC_SEQ 29 +#define UNION_TYPE 6 +#define TYPE_REFERENCE 10 +#define TYPE_COMPONENT 12 +#define COMMENT 27 +#define TYPE_ANNOTATION 11 +#define ARRAY 17 +#define T__42 42 +#define T__43 43 +#define T__40 40 +#define T__41 41 +#define RECORD 20 +#define T__46 46 +#define T__47 47 +#define T__44 44 +#define T__45 45 +#define TAGGED_VALUE 19 +#define T__48 48 +#define T__49 49 +#define VALUE_DEFINITIONS 13 +#define UNICODE_ESC 32 +#define HEX_DIGIT 31 +#define INT 24 +#define VARIANT 16 +#define WS 28 +#define T__34 34 +#define TYPE_DEFINITIONS 4 +#define T__35 35 +#define T__36 36 +#define T__37 37 +#define T__38 38 +#define T__39 39 +#define MAP 21 +#define TYPE_DEFINITION 5 +#define ASSIGNMENT 22 +#define NO_VALUE 15 +#define STRING 30 +#ifdef EOF +#undef EOF +#define EOF ANTLR3_TOKEN_EOF +#endif + +#ifndef TOKENSOURCE +#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource +#endif + +/* End of token definitions for SimanticsDataParser + * ============================================================================= + */ +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif + +/* END - Note:Keep extra line feed to satisfy UNIX systems */