version 1.22, 2002/07/25 16:19:45
|
version 1.23, 2002/07/30 16:14:53
|
|
|
#include <cstdio> | #include <cstdio> |
#include <cstring> | #include <cstring> |
#include <Pegasus/Common/String.h> | #include <Pegasus/Common/String.h> |
|
#include <Pegasus/Common/CIMName.h> |
#include "cimmofParser.h" | #include "cimmofParser.h" |
#include "valueFactory.h" | #include "valueFactory.h" |
#include "memobjs.h" | #include "memobjs.h" |
|
|
CIMClass *g_currentClass = 0; | CIMClass *g_currentClass = 0; |
CIMInstance *g_currentInstance = 0; | CIMInstance *g_currentInstance = 0; |
String g_currentAlias = String::EMPTY; | String g_currentAlias = String::EMPTY; |
String g_referenceClassName = String::EMPTY; |
CIMName g_referenceClassName = CIMName(); |
KeyBindingArray g_KeyBindingArray; // it gets created empty | KeyBindingArray g_KeyBindingArray; // it gets created empty |
TYPED_INITIALIZER_VALUE g_typedInitializerValue; | TYPED_INITIALIZER_VALUE g_typedInitializerValue; |
| |
|
|
int ival; | int ival; |
// char *strval; | // char *strval; |
String * strval; | String * strval; |
|
CIMName * cimnameval; |
CIMType datatype; | CIMType datatype; |
CIMValue * value; | CIMValue * value; |
String * strptr; | String * strptr; |
|
|
%token TOK_UNEXPECTED_CHAR | %token TOK_UNEXPECTED_CHAR |
%token TOK_END_OF_FILE | %token TOK_END_OF_FILE |
| |
%type <strval> pragmaName pragmaVal qualifierName keyValuePairName |
%type <strval> pragmaName pragmaVal keyValuePairName qualifierName |
%type <strval> propertyName parameterName methodName className |
|
%type <strval> fileName referencedObject referenceName referencePath | %type <strval> fileName referencedObject referenceName referencePath |
%type <strval> TOK_POSITIVE_DECIMAL_VALUE TOK_OCTAL_VALUE TOK_HEX_VALUE | %type <strval> TOK_POSITIVE_DECIMAL_VALUE TOK_OCTAL_VALUE TOK_HEX_VALUE |
%type <strval> TOK_SIGNED_DECIMAL_VALUE TOK_BINARY_VALUE | %type <strval> TOK_SIGNED_DECIMAL_VALUE TOK_BINARY_VALUE |
|
|
%type <strval> stringValue stringValues initializer constantValue | %type <strval> stringValue stringValues initializer constantValue |
%type <strval> nonNullConstantValue | %type <strval> nonNullConstantValue |
%type <strval> arrayInitializer constantValues | %type <strval> arrayInitializer constantValues |
|
%type <strval> TOK_ALIAS_IDENTIFIER alias aliasIdentifier |
%type <strval> integerValue TOK_REAL_VALUE TOK_CHAR_VALUE | %type <strval> integerValue TOK_REAL_VALUE TOK_CHAR_VALUE |
%type <strval> superClass TOK_ALIAS_IDENTIFIER alias aliasIdentifier |
|
%type <strval> namespaceHandle namespaceHandleRef | %type <strval> namespaceHandle namespaceHandleRef |
%type <strval> referenceInitializer aliasInitializer objectHandle | %type <strval> referenceInitializer aliasInitializer objectHandle |
%type <strval> TOK_UNEXPECTED_CHAR | %type <strval> TOK_UNEXPECTED_CHAR |
| |
|
%type <cimnameval> propertyName parameterName methodName className |
|
%type <cimnameval> superClass |
|
|
%type <typedinitializer> typedInitializer typedDefaultValue | %type <typedinitializer> typedInitializer typedDefaultValue |
%type <typedinitializer> typedQualifierParameter | %type <typedinitializer> typedQualifierParameter |
| |
|
|
| |
className: TOK_SIMPLE_IDENTIFIER { } ; | className: TOK_SIMPLE_IDENTIFIER { } ; |
| |
superClass: TOK_COLON className { $$ = $2; } |
superClass: TOK_COLON className { $$ = new CIMName(*$2); } |
| /* empty */ { $$ = new String(String::EMPTY); } ; |
| /* empty */ { $$ = new CIMName(); } ; |
| |
classBody: TOK_LEFTCURLYBRACE classFeatures TOK_RIGHTCURLYBRACE TOK_SEMICOLON | classBody: TOK_LEFTCURLYBRACE classFeatures TOK_RIGHTCURLYBRACE TOK_SEMICOLON |
| TOK_LEFTCURLYBRACE TOK_RIGHTCURLYBRACE TOK_SEMICOLON ; | | TOK_LEFTCURLYBRACE TOK_RIGHTCURLYBRACE TOK_SEMICOLON ; |
|
|
referencePath: TOK_EQUAL stringValue { $$ = $2; } | referencePath: TOK_EQUAL stringValue { $$ = $2; } |
| /* empty */ { $$ = new String(String::EMPTY); } ; | | /* empty */ { $$ = new String(String::EMPTY); } ; |
| |
methodName: TOK_SIMPLE_IDENTIFIER ; |
methodName: TOK_SIMPLE_IDENTIFIER { $$ = new CIMName(*$1); } ; |
| |
parameters : parameter | parameters : parameter |
| parameters TOK_COMMA parameter | | parameters TOK_COMMA parameter |
|
|
} else { | } else { |
p = cp->newParameter(*$3, $2, true, $4, g_referenceClassName); | p = cp->newParameter(*$3, $2, true, $4, g_referenceClassName); |
} | } |
g_referenceClassName = String::EMPTY; |
g_referenceClassName = CIMName(); |
apply(&g_qualifierList, p); | apply(&g_qualifierList, p); |
cp->applyParameter(*g_currentMethod, *p); | cp->applyParameter(*g_currentMethod, *p); |
delete p; | delete p; |
|
|
objectRef: className TOK_REF { | objectRef: className TOK_REF { |
g_referenceClassName = *$1; } ; | g_referenceClassName = *$1; } ; |
| |
parameterName: TOK_SIMPLE_IDENTIFIER ; |
parameterName: TOK_SIMPLE_IDENTIFIER { $$ = new CIMName(*$1); } ; |
| |
propertyName: TOK_SIMPLE_IDENTIFIER ; |
propertyName: TOK_SIMPLE_IDENTIFIER { $$ = new CIMName(*$1); } ; |
| |
array: TOK_LEFTSQUAREBRACKET TOK_POSITIVE_DECIMAL_VALUE | array: TOK_LEFTSQUAREBRACKET TOK_POSITIVE_DECIMAL_VALUE |
TOK_RIGHTSQUAREBRACKET | TOK_RIGHTSQUAREBRACKET |