//.........这里部分代码省略.........
Value->Type = EFI_IFR_TYPE_STRING;
Value->Value.string = OpCode->Value.Value.string;
break;
//
// Constant
//
case EFI_IFR_TRUE_OP:
case EFI_IFR_FALSE_OP:
case EFI_IFR_ONE_OP:
case EFI_IFR_ONES_OP:
case EFI_IFR_UINT8_OP:
case EFI_IFR_UINT16_OP:
case EFI_IFR_UINT32_OP:
case EFI_IFR_UINT64_OP:
case EFI_IFR_UNDEFINED_OP:
case EFI_IFR_VERSION_OP:
case EFI_IFR_ZERO_OP:
Value = &OpCode->Value;
break;
//
// unary-op
//
case EFI_IFR_LENGTH_OP:
Status = PopExpression (Value);
if (EFI_ERROR (Status)) {
return Status;
}
if (Value->Type != EFI_IFR_TYPE_STRING) {
return EFI_INVALID_PARAMETER;
}
StrPtr = GetToken (Value->Value.string, FormSet->HiiHandle);
if (StrPtr == NULL) {
return EFI_INVALID_PARAMETER;
}
Value->Type = EFI_IFR_TYPE_NUM_SIZE_64;
Value->Value.u64 = EfiStrLen (StrPtr);
gBS->FreePool (StrPtr);
break;
case EFI_IFR_NOT_OP:
Status = PopExpression (Value);
if (EFI_ERROR (Status)) {
return Status;
}
if (Value->Type != EFI_IFR_TYPE_BOOLEAN) {
return EFI_INVALID_PARAMETER;
}
Value->Value.b = !Value->Value.b;
break;
case EFI_IFR_QUESTION_REF2_OP:
//
// Pop an expression from the expression stack
//
Status = PopExpression (Value);
if (EFI_ERROR (Status)) {
return Status;
}
//
// Validate the expression value
//
开发者ID:Kohrara,项目名称:edk,代码行数:67,代码来源:Expression.c
示例3: IfrCatenate
EFI_STATUS
IfrCatenate (
IN FORM_BROWSER_FORMSET *FormSet,
OUT EFI_HII_VALUE *Result
)
/*++
Routine Description:
Evaluate opcode EFI_IFR_CATENATE.
Arguments:
FormSet - Formset which contains this opcode.
Result - Evaluation result for this opcode.
Returns:
EFI_SUCCESS - Opcode evaluation success.
Other - Opcode evaluation failed.
--*/
{
EFI_STATUS Status;
EFI_HII_VALUE Value;
CHAR16 *String[2];
UINTN Index;
CHAR16 *StringPtr;
//
// String[0] - The second string
// String[1] - The first string
//
String[0] = NULL;
String[1] = NULL;
StringPtr = NULL;
Status = EFI_SUCCESS;
for (Index = 0; Index < 2; Index++) {
Status = PopExpression (&Value);
if (EFI_ERROR (Status)) {
goto Done;
}
if (Value.Type != EFI_IFR_TYPE_STRING) {
Status = EFI_UNSUPPORTED;
goto Done;
}
String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle);
if (String== NULL) {
Status = EFI_NOT_FOUND;
goto Done;
}
}
StringPtr= EfiLibAllocatePool (EfiStrSize (String[1]) + EfiStrSize (String[0]));
ASSERT (StringPtr != NULL);
EfiStrCpy (StringPtr, String[1]);
EfiStrCat (StringPtr, String[0]);
Result->Type = EFI_IFR_TYPE_STRING;
Result->Value.string = NewString (StringPtr, FormSet->HiiHandle);
Done:
EfiLibSafeFreePool (String[0]);
EfiLibSafeFreePool (String[1]);
EfiLibSafeFreePool (StringPtr);
return Status;
}
开发者ID:Kohrara,项目名称:edk,代码行数:68,代码来源:Expression.c
示例4: GetVersion
std::string IDSEXT::InvokeMethod(const std::string& command)
{
int index = command.find_first_of(" ");
string strCommand = command.substr(0, index);
string strParam = command.substr(index + 1, command.length());
Json::Reader reader;
Json::Value obj;
if (strCommand == "getVersion") {
return GetVersion();
} else if (strCommand == "registerProvider") {
return RegisterProvider(strParam);
} else if (strCommand == "setOption") {
// parse the JSON
bool parse = reader.parse(strParam, obj);
if (!parse) {
//fprintf(stderr, "%s\n", "error parsing\n");
return "unable to parse options";
}
int option = obj["option"].asInt();
const std::string value = obj["value"].asString();
return( SetOption(option, value) );
} else if (strCommand == "getToken") {
// parse the JSON
bool parse = reader.parse(strParam, obj);
if (!parse) {
//fprintf(stderr, "%s", "error parsing\n");
return "unable to parse options";
}
event_id = obj["_eventId"].asString();
std::string provider = obj["provider"].asString();
std::string tokenType = obj["tokenType"].asString();
const std::string appliesTo = obj["appliesTo"].asString();
GetToken(provider, tokenType, appliesTo);
} else if (strCommand == "clearToken") {
// parse the JSON
bool parse = reader.parse(strParam, obj);
if (!parse) {
//fprintf(stderr, "%s", "error parsing\n");
return "unable to parse options";
}
event_id = obj["_eventId"].asString();
std::string provider = obj["provider"].asString();
std::string tokenType = obj["tokenType"].asString();
const std::string appliesTo = obj["appliesTo"].asString();
ClearToken(provider, tokenType, appliesTo);
} else if (strCommand == "getProperties") {
// parse the JSON
bool parse = reader.parse(strParam, obj);
if (!parse) {
//fprintf(stderr, "%s", "error parsing\n");
return "unable to parse options";
}
event_id = obj["_eventId"].asString();
std::string provider = obj["provider"].asString();
int propertyType = obj["propertyType"].asInt();
int numProps = obj["numProps"].asInt();
const std::string userProps = obj["userProperties"].asString();
GetProperties(provider, propertyType, numProps, userProps);
} else if (strCommand == "getData") {
// parse the JSON
bool parse = reader.parse(strParam, obj);
if (!parse) {
//fprintf(stderr, "%s", "error parsing\n");
return "unable to parse options";
}
event_id = obj["_eventId"].asString();
std::string provider = obj["provider"].asString();
int dataType = obj["dataType"].asInt();
int dataFlags = obj["dataFlags"].asInt();
const std::string dataName = obj["dataName"].asString();
GetData(provider, dataType, dataFlags, dataName);
} else if (strCommand == "createData") {
// parse the JSON
bool parse = reader.parse(strParam, obj);
if (!parse) {
//fprintf(stderr, "%s", "error parsing\n");
return "unable to parse options";
}
event_id = obj["_eventId"].asString();
std::string provider = obj["provider"].asString();
int dataType = obj["dataType"].asInt();
int dataFlags = obj["dataFlags"].asInt();
const std::string dataName = obj["dataName"].asString();
const std::string dataValue = obj["dataValue"].asString();
CreateData(provider, dataType, dataFlags, dataName, dataValue);
} else if (strCommand == "deleteData") {
// parse the JSON
bool parse = reader.parse(strParam, obj);
if (!parse) {
//fprintf(stderr, "%s", "error parsing\n");
return "unable to parse options";
}
event_id = obj["_eventId"].asString();
//.........这里部分代码省略.........
EFI_STATUS
IfrSpan (
IN FORM_BROWSER_FORMSET *FormSet,
IN UINT8 Flags,
OUT EFI_HII_VALUE *Result
)
/*++
Routine Description:
Evaluate opcode EFI_IFR_SPAN.
Arguments:
FormSet - Formset which contains this opcode.
Flags - FIRST_MATCHING or FIRST_NON_MATCHING.
Result - Evaluation result for this opcode.
Returns:
EFI_SUCCESS - Opcode evaluation success.
Other - Opcode evaluation failed.
--*/
{
EFI_STATUS Status;
EFI_HII_VALUE Value;
CHAR16 *String[2];
CHAR16 *Charset;
UINTN Base;
UINTN Index;
CHAR16 *StringPtr;
BOOLEAN Found;
Status = PopExpression (&Value);
if (EFI_ERROR (Status)) {
return Status;
}
if (Value.Type > EFI_IFR_TYPE_NUM_SIZE_64) {
return EFI_UNSUPPORTED;
}
Base = (UINTN) Value.Value.u64;
//
// String[0] - Charset
// String[1] - The string to search
//
String[0] = NULL;
String[1] = NULL;
for (Index = 0; Index < 2; Index++) {
Status = PopExpression (&Value);
if (EFI_ERROR (Status)) {
goto Done;
}
if (Value.Type != EFI_IFR_TYPE_STRING) {
Status = EFI_UNSUPPORTED;
goto Done;
}
String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle);
if (String== NULL) {
Status = EFI_NOT_FOUND;
goto Done;
}
}
if (Base >= EfiStrLen (String[1])) {
Status = EFI_UNSUPPORTED;
goto Done;
}
Found = FALSE;
StringPtr = String[1] + Base;
Charset = String[0];
while (*StringPtr != 0 && !Found) {
Index = 0;
while (Charset[Index] != 0) {
if (*StringPtr >= Charset[Index] && *StringPtr <= Charset[Index + 1]) {
if (Flags == EFI_IFR_FLAGS_FIRST_MATCHING) {
Found = TRUE;
break;
}
} else {
if (Flags == EFI_IFR_FLAGS_FIRST_NON_MATCHING) {
Found = TRUE;
break;
}
}
//
// Skip characters pair representing low-end of a range and high-end of a range
//
Index += 2;
}
if (!Found) {
StringPtr++;
}
}
Result->Type = EFI_IFR_TYPE_NUM_SIZE_64;
Result->Value.u64 = StringPtr - String[1];
//.........这里部分代码省略.........
开发者ID:Kohrara,项目名称:edk,代码行数:101,代码来源:Expression.c
示例6: SavePPBuffer
/************************************************************
NAME : ParseSlot
DESCRIPTION : Parses slot definitions for a
defclass statement
INPUTS : 1) The logical name of the input source
2) The current slot list
3) The class precedence list for the class
to which this slot is being attached
(used to find facets for composite slots)
4) A flag indicating if this is a multifield
slot or not
5) A flag indicating if the type of slot
(single or multi) was explicitly
specified or not
RETURNS : The address of the list of slots,
NULL if there was an error
SIDE EFFECTS : The slot list is allocated
NOTES : Assumes "(slot" has already been parsed.
************************************************************/
TEMP_SLOT_LINK *ParseSlot(
Environment *theEnv,
const char *readSource,
const char *className,
TEMP_SLOT_LINK *slist,
PACKED_CLASS_LINKS *preclist,
bool multiSlot)
{
SlotDescriptor *slot;
CONSTRAINT_PARSE_RECORD parsedConstraint;
char specbits[2];
int rtnCode;
CLIPSLexeme *newOverrideMsg;
/* ===============================================================
Bits in specbits are when slot qualifiers are specified so that
duplicate or conflicting qualifiers can be detected.
Shared/local bit-0
Single/multiple bit-1
Read-only/Read-write/Initialize-Only bit-2
Inherit/No-inherit bit-3
Composite/Exclusive bit-4
Reactive/Nonreactive bit-5
Default bit-6
Default-dynamic bit-7
Visibility bit-8
Override-message bit-9
=============================================================== */
SavePPBuffer(theEnv," ");
specbits[0] = specbits[1] = '\0';
GetToken(theEnv,readSource,&DefclassData(theEnv)->ObjectParseToken);
if (DefclassData(theEnv)->ObjectParseToken.tknType != SYMBOL_TOKEN)
{
DeleteSlots(theEnv,slist);
SyntaxErrorMessage(theEnv,"defclass slot");
return NULL;
}
if ((DefclassData(theEnv)->ObjectParseToken.value == (void *) DefclassData(theEnv)->ISA_SYMBOL) ||
(DefclassData(theEnv)->ObjectParseToken.value == (void *) DefclassData(theEnv)->NAME_SYMBOL))
{
DeleteSlots(theEnv,slist);
SyntaxErrorMessage(theEnv,"defclass slot");
return NULL;
}
slot = NewSlot(theEnv,DefclassData(theEnv)->ObjectParseToken.lexemeValue);
slist = InsertSlot(theEnv,className,slist,slot);
if (slist == NULL)
return NULL;
if (multiSlot)
{
slot->multiple = true;
SetBitMap(specbits,FIELD_BIT);
}
GetToken(theEnv,readSource,&DefclassData(theEnv)->ObjectParseToken);
IncrementIndentDepth(theEnv,3);
InitializeConstraintParseRecord(&parsedConstraint);
while (DefclassData(theEnv)->ObjectParseToken.tknType == LEFT_PARENTHESIS_TOKEN)
{
PPBackup(theEnv);
PPCRAndIndent(theEnv);
SavePPBuffer(theEnv,"(");
GetToken(theEnv,readSource,&DefclassData(theEnv)->ObjectParseToken);
if (DefclassData(theEnv)->ObjectParseToken.tknType != SYMBOL_TOKEN)
{
SyntaxErrorMessage(theEnv,"defclass slot");
goto ParseSlotError;
}
else if (strcmp(DefclassData(theEnv)->ObjectParseToken.lexemeValue->contents,DEFAULT_FACET) == 0)
{
if (ParseDefaultFacet(theEnv,readSource,specbits,slot) == false)
goto ParseSlotError;
}
else if (strcmp(DefclassData(theEnv)->ObjectParseToken.lexemeValue->contents,DYNAMIC_FACET) == 0)
{
SetBitMap(specbits,DEFAULT_DYNAMIC_BIT);
if (ParseDefaultFacet(theEnv,readSource,specbits,slot) == false)
goto ParseSlotError;
}
else if (strcmp(DefclassData(theEnv)->ObjectParseToken.lexemeValue->contents,ACCESS_FACET) == 0)
//.........这里部分代码省略.........
globle int CheckSyntax(
void *theEnv,
char *theString,
DATA_OBJECT_PTR returnValue)
{
char *name;
struct token theToken;
struct expr *top;
short rv;
/*==============================*/
/* Set the default return value */
/* (TRUE for problems found). */
/*==============================*/
SetpType(returnValue,SYMBOL);
SetpValue(returnValue,EnvTrueSymbol(theEnv));
/*===========================================*/
/* Create a string source router so that the */
/* string can be used as an input source. */
/*===========================================*/
if (OpenStringSource(theEnv,"check-syntax",theString,0) == 0)
{ return(TRUE); }
/*=================================*/
/* Only expressions and constructs */
/* can have their syntax checked. */
/*=================================*/
GetToken(theEnv,"check-syntax",&theToken);
if (theToken.type != LPAREN)
{
CloseStringSource(theEnv,"check-syntax");
SetpValue(returnValue,EnvAddSymbol(theEnv,"MISSING-LEFT-PARENTHESIS"));
return(TRUE);
}
/*========================================*/
/* The next token should be the construct */
/* type or function name. */
/*========================================*/
GetToken(theEnv,"check-syntax",&theToken);
if (theToken.type != SYMBOL)
{
CloseStringSource(theEnv,"check-syntax");
SetpValue(returnValue,EnvAddSymbol(theEnv,"EXPECTED-SYMBOL-AFTER-LEFT-PARENTHESIS"));
return(TRUE);
}
name = ValueToString(theToken.value);
/*==============================================*/
/* Set up a router to capture the error output. */
/*==============================================*/
EnvAddRouter(theEnv,"error-capture",40,
FindErrorCapture, PrintErrorCapture,
NULL, NULL, NULL);
/*================================*/
/* Determine if it's a construct. */
/*================================*/
if (FindConstruct(theEnv,name))
{
ConstructData(theEnv)->CheckSyntaxMode = TRUE;
rv = (short) ParseConstruct(theEnv,name,"check-syntax");
GetToken(theEnv,"check-syntax",&theToken);
ConstructData(theEnv)->CheckSyntaxMode = FALSE;
if (rv)
{
EnvPrintRouter(theEnv,WERROR,"\nERROR:\n");
PrintInChunks(theEnv,WERROR,GetPPBuffer(theEnv));
EnvPrintRouter(theEnv,WERROR,"\n");
}
DestroyPPBuffer(theEnv);
CloseStringSource(theEnv,"check-syntax");
if ((rv != FALSE) || (ParseFunctionData(theEnv)->WarningString != NULL))
{
SetErrorCaptureValues(theEnv,returnValue);
DeactivateErrorCapture(theEnv);
return(TRUE);
}
if (theToken.type != STOP)
{
SetpValue(returnValue,EnvAddSymbol(theEnv,"EXTRANEOUS-INPUT-AFTER-LAST-PARENTHESIS"));
DeactivateErrorCapture(theEnv);
return(TRUE);
}
SetpType(returnValue,SYMBOL);
//.........这里部分代码省略.........
static struct expr *ParseAssertSlotValues(
void *theEnv,
EXEC_STATUS,
char *inputSource,
struct token *tempToken,
struct templateSlot *slotPtr,
int *error,
int constantsOnly)
{
struct expr *nextSlot;
struct expr *newField, *valueList, *lastValue;
int printError;
/*=============================*/
/* Handle a single field slot. */
/*=============================*/
if (slotPtr->multislot == FALSE)
{
/*=====================*/
/* Get the slot value. */
/*=====================*/
SavePPBuffer(theEnv,execStatus," ");
newField = GetAssertArgument(theEnv,execStatus,inputSource,tempToken,
error,RPAREN,constantsOnly,&printError);
if (*error)
{
if (printError) SyntaxErrorMessage(theEnv,execStatus,"deftemplate pattern");
return(NULL);
}
/*=================================================*/
/* A single field slot value must contain a value. */
/* Only a multifield slot can be empty. */
/*=================================================*/
if (newField == NULL)
{
*error = TRUE;
SingleFieldSlotCardinalityError(theEnv,execStatus,slotPtr->slotName->contents);
return(NULL);
}
/*==============================================*/
/* A function returning a multifield value can */
/* not be called to get the value for the slot. */
/*==============================================*/
if ((newField->type == FCALL) ? (ExpressionFunctionType(newField) == 'm') :
(newField->type == MF_VARIABLE))
{
*error = TRUE;
SingleFieldSlotCardinalityError(theEnv,execStatus,slotPtr->slotName->contents);
ReturnExpression(theEnv,execStatus,newField);
return(NULL);
}
/*============================*/
/* Move on to the next token. */
/*============================*/
GetToken(theEnv,execStatus,inputSource,tempToken);
}
/*========================================*/
/* Handle a multifield slot. Build a list */
/* of the values stored in the slot. */
/*========================================*/
else
{
SavePPBuffer(theEnv,execStatus," ");
valueList = GetAssertArgument(theEnv,execStatus,inputSource,tempToken,
error,RPAREN,constantsOnly,&printError);
if (*error)
{
if (printError) SyntaxErrorMessage(theEnv,execStatus,"deftemplate pattern");
return(NULL);
}
if (valueList == NULL)
{
PPBackup(theEnv,execStatus);
PPBackup(theEnv,execStatus);
SavePPBuffer(theEnv,execStatus,")");
}
lastValue = valueList;
while (lastValue != NULL) /* (tempToken->type != RPAREN) */
{
if (tempToken->type == RPAREN)
{ SavePPBuffer(theEnv,execStatus," "); }
else
{
/* PPBackup(theEnv,execStatus); */
SavePPBuffer(theEnv,execStatus," ");
/* SavePPBuffer(theEnv,execStatus,tempToken->printForm); */
//.........这里部分代码省略.........
开发者ID:atrniv,项目名称:CLIPS,代码行数:101,代码来源:tmpltrhs.c
示例13: GetToken
static struct templateSlot *ParseSlotLabel(
void *theEnv,
EXEC_STATUS,
char *inputSource,
struct token *tempToken,
struct deftemplate *theDeftemplate,
int *error,
int endType)
{
struct templateSlot *slotPtr;
short position;
/*========================*/
/* Initialize error flag. */
/*========================*/
*error = FALSE;
/*============================================*/
/* If token is a right parenthesis, then fact */
/* template definition is complete. */
/*============================================*/
GetToken(theEnv,execStatus,inputSource,tempToken);
if (tempToken->type == endType)
{ return(NULL); }
/*=======================================*/
/* Put a space between the template name */
/* and the first slot definition. */
/*=======================================*/
PPBackup(theEnv,execStatus);
SavePPBuffer(theEnv,execStatus," ");
SavePPBuffer(theEnv,execStatus,tempToken->printForm);
/*=======================================================*/
/* Slot definition begins with opening left parenthesis. */
/*=======================================================*/
if (tempToken->type != LPAREN)
{
SyntaxErrorMessage(theEnv,execStatus,"deftemplate pattern");
*error = TRUE;
return(NULL);
}
/*=============================*/
/* Slot name must be a symbol. */
/*=============================*/
GetToken(theEnv,execStatus,inputSource,tempToken);
if (tempToken->type != SYMBOL)
{
SyntaxErrorMessage(theEnv,execStatus,"deftemplate pattern");
*error = TRUE;
return(NULL);
}
/*======================================================*/
/* Check that the slot name is valid for this template. */
/*======================================================*/
if ((slotPtr = FindSlot(theDeftemplate,(SYMBOL_HN *) tempToken->value,&position)) == NULL)
{
InvalidDeftemplateSlotMessage(theEnv,execStatus,ValueToString(tempToken->value),
ValueToString(theDeftemplate->header.name),TRUE);
*error = TRUE;
return(NULL);
}
/*====================================*/
/* Return a pointer to the slot name. */
/*====================================*/
return(slotPtr);
}
开发者ID:atrniv,项目名称:CLIPS,代码行数:77,代码来源:tmpltrhs.c
示例14: LoadMapSettings
void LoadMapSettings(LPSTR szFileName)
{
if ( (SMDFile = fopen(szFileName, "r")) == NULL ) //ok
{
return;
}
SMDToken Token;
int iType = 0;
while ( true )
{
Token = GetToken();
if (Token == END )
{
break;
}
iType = TokenNumber;
while ( true )
{
Token = GetToken();
if ( Token == END )
{
break;
}
if ( iType >= 0 && iType <= MAX_NUMBER_MAP-1)
{
if ( strcmp("end", TokenString) == 0 )
{
break;
}
int ExpSingleInc = 0;
int ExpPartyInc = 0;
int DropIncrease = 0;
int DropExcIncrease = 0;
ExpSingleInc = TokenNumber;
Token = GetToken();
ExpPartyInc = TokenNumber;
Token = GetToken();
DropIncrease = TokenNumber;
Token = GetToken();
DropExcIncrease = TokenNumber;
Token = GetToken();
g_MAP_SETTINGS[iType].drop_zen_increase = TokenNumber;
g_MAP_SETTINGS[iType].exp_increase = ExpSingleInc;
g_MAP_SETTINGS[iType].exp_party_increase = ExpPartyInc;
g_MAP_SETTINGS[iType].drop_increase = DropIncrease;
g_MAP_SETTINGS[iType].drop_exc_increase = DropExcIncrease;
}
}
}
fclose(SMDFile);
}
/****************************************************************
NAME : ParseSimpleFacet
DESCRIPTION : Parses the following facets for a slot:
access, source, propagation, storage,
pattern-match, visibility and override-message
INPUTS : 1) The input logical name
2) The bitmap indicating which facets have
already been parsed
3) The name of the facet
4) The bit to test/set in arg #2 for this facet
5) The facet value string which indicates the
facet should be false
6) The facet value string which indicates the
facet should be true
7) An alternate value string for use when the
first two don't match (can be NULL)
7) An alternate value string for use when the
first three don't match (can be NULL)
(will be an SF_VARIABLE type)
9) A buffer to hold the facet value symbol
(can be NULL - only set if args #5 and #6
are both NULL)
RETURNS : -1 on errors
0 if first value string matched
1 if second value string matched
2 if alternate value string matched
3 if variable value string matched
4 if facet value buffer was set
SIDE EFFECTS : Messages printed on errors
Bitmap marked indicating facet was parsed
Facet value symbol buffer set, if appropriate
NOTES : None
*****************************************************************/
static int ParseSimpleFacet(
Environment *theEnv,
const char *readSource,
SlotDescriptor *slot,
char *specbits,
const char *facetName,
int testBit,
const char *clearRelation,
const char *setRelation,
const char *alternateRelation,
const char *varRelation,
CLIPSLexeme **facetSymbolicValue)
{
int rtnCode;
if (TestBitMap(specbits,testBit))
{
PrintErrorID(theEnv,"CLSLTPSR",2,false);
WriteString(theEnv,STDERR,"The '");
WriteString(theEnv,STDERR,facetName);
WriteString(theEnv,STDERR,"' facet for slot '");
WriteString(theEnv,STDERR,slot->slotName->name->contents);
WriteString(theEnv,STDERR,"' is already specified.\n");
return -1;
}
SetBitMap(specbits,testBit);
SavePPBuffer(theEnv," ");
GetToken(theEnv,readSource,&DefclassData(theEnv)->ObjectParseToken);
/* ===============================
Check for the variable relation
=============================== */
if (DefclassData(theEnv)->ObjectParseToken.tknType == SF_VARIABLE_TOKEN)
{
if ((varRelation == NULL) ? false :
(strcmp(DefclassData(theEnv)->ObjectParseToken.lexemeValue->contents,varRelation) == 0))
rtnCode = 3;
else
goto ParseSimpleFacetError;
}
else
{
if (DefclassData(theEnv)->ObjectParseToken.tknType != SYMBOL_TOKEN)
goto ParseSimpleFacetError;
/* ===================================================
If the facet value buffer is non-NULL
simply get the value and do not check any relations
=================================================== */
if (facetSymbolicValue == NULL)
{
if (strcmp(DefclassData(theEnv)->ObjectParseToken.lexemeValue->contents,clearRelation) == 0)
rtnCode = 0;
else if (strcmp(DefclassData(theEnv)->ObjectParseToken.lexemeValue->contents,setRelation) == 0)
rtnCode = 1;
else if ((alternateRelation == NULL) ? false :
(strcmp(DefclassData(theEnv)->ObjectParseToken.lexemeValue->contents,alternateRelation) == 0))
rtnCode = 2;
else
goto ParseSimpleFacetError;
}
else
{
rtnCode = 4;
*facetSymbolicValue = DefclassData(theEnv)->ObjectParseToken.lexemeValue;
}
}
//.........这里部分代码省略.........
请发表评论