Lines 245-256
static const SmTokenTableEntry aTokenTab
Link Here
|
245 |
{ "ni", TNI, MS_NI, TGRELATION, 0}, |
245 |
{ "ni", TNI, MS_NI, TGRELATION, 0}, |
246 |
{ "nitalic", TNITALIC, '\0', TGFONTATTR, 5}, |
246 |
{ "nitalic", TNITALIC, '\0', TGFONTATTR, 5}, |
247 |
{ "none", TNONE, '\0', TGLBRACES | TGRBRACES, 0}, |
247 |
{ "none", TNONE, '\0', TGLBRACES | TGRBRACES, 0}, |
|
|
248 |
{ "nospace", TNOSPACE, '\0', TGSTANDALONE, 5}, |
248 |
{ "notin", TNOTIN, MS_NOTIN, TGRELATION, 0}, |
249 |
{ "notin", TNOTIN, MS_NOTIN, TGRELATION, 0}, |
|
|
250 |
{ "nroot", TNROOT, MS_SQRT, TGUNOPER, 5}, |
249 |
{ "nsubset", TNSUBSET, MS_NSUBSET, TGRELATION, 0 }, |
251 |
{ "nsubset", TNSUBSET, MS_NSUBSET, TGRELATION, 0 }, |
250 |
{ "nsupset", TNSUPSET, MS_NSUPSET, TGRELATION, 0 }, |
252 |
{ "nsupset", TNSUPSET, MS_NSUPSET, TGRELATION, 0 }, |
251 |
{ "nsubseteq", TNSUBSETEQ, MS_NSUBSETEQ, TGRELATION, 0 }, |
253 |
{ "nsubseteq", TNSUBSETEQ, MS_NSUBSETEQ, TGRELATION, 0 }, |
252 |
{ "nsupseteq", TNSUPSETEQ, MS_NSUPSETEQ, TGRELATION, 0 }, |
254 |
{ "nsupseteq", TNSUPSETEQ, MS_NSUPSETEQ, TGRELATION, 0 }, |
253 |
{ "nroot", TNROOT, MS_SQRT, TGUNOPER, 5}, |
|
|
254 |
{ "odivide", TODIVIDE, MS_ODIVIDE, TGPRODUCT, 0}, |
255 |
{ "odivide", TODIVIDE, MS_ODIVIDE, TGPRODUCT, 0}, |
255 |
{ "odot", TODOT, MS_ODOT, TGPRODUCT, 0}, |
256 |
{ "odot", TODOT, MS_ODOT, TGPRODUCT, 0}, |
256 |
{ "ominus", TOMINUS, MS_OMINUS, TGSUM, 0}, |
257 |
{ "ominus", TOMINUS, MS_OMINUS, TGSUM, 0}, |
Lines 734-740
void SmParser::NextToken()
Link Here
|
734 |
xub_StrLen nTmpStart = sal::static_int_cast< xub_StrLen >(rnEndPos + |
735 |
xub_StrLen nTmpStart = sal::static_int_cast< xub_StrLen >(rnEndPos + |
735 |
aTmpRes.LeadingWhiteSpace); |
736 |
aTmpRes.LeadingWhiteSpace); |
736 |
|
737 |
|
737 |
// default setting fo the case that no identifier |
738 |
// default setting for the case that no identifier |
738 |
// i.e. a valid symbol-name is following the '%' |
739 |
// i.e. a valid symbol-name is following the '%' |
739 |
// character |
740 |
// character |
740 |
CurToken.eType = TTEXT; |
741 |
CurToken.eType = TTEXT; |
Lines 1135-1140
void SmParser::Line()
Link Here
|
1135 |
|
1136 |
|
1136 |
void SmParser::Expression() |
1137 |
void SmParser::Expression() |
1137 |
{ |
1138 |
{ |
|
|
1139 |
BOOL bUseExtraSpaces = TRUE; |
1140 |
SmNode *pNode = NodeStack.Pop(); |
1141 |
if (pNode) |
1142 |
if (pNode->GetToken().eType == TNOSPACE) |
1143 |
bUseExtraSpaces = FALSE; |
1144 |
else |
1145 |
NodeStack.Push(pNode); |
1146 |
|
1138 |
USHORT n = 0; |
1147 |
USHORT n = 0; |
1139 |
SmNodeArray RelationArray; |
1148 |
SmNodeArray RelationArray; |
1140 |
|
1149 |
|
Lines 1150-1157
void SmParser::Expression()
Link Here
|
1150 |
RelationArray.Put(n - 1, NodeStack.Pop()); |
1159 |
RelationArray.Put(n - 1, NodeStack.Pop()); |
1151 |
} |
1160 |
} |
1152 |
|
1161 |
|
1153 |
SmStructureNode *pSNode = new SmExpressionNode(CurToken); |
1162 |
SmExpressionNode *pSNode = new SmExpressionNode(CurToken); |
1154 |
pSNode->SetSubNodes(RelationArray); |
1163 |
pSNode->SetSubNodes(RelationArray); |
|
|
1164 |
pSNode->SetUseExtraSpaces(bUseExtraSpaces); |
1155 |
NodeStack.Push(pSNode); |
1165 |
NodeStack.Push(pSNode); |
1156 |
} |
1166 |
} |
1157 |
|
1167 |
|
Lines 1273-1279
void SmParser::SubSup(ULONG nActiveGroup
Link Here
|
1273 |
return; |
1283 |
return; |
1274 |
|
1284 |
|
1275 |
SmSubSupNode *pNode = new SmSubSupNode(CurToken); |
1285 |
SmSubSupNode *pNode = new SmSubSupNode(CurToken); |
1276 |
//! Of course 'CurToken' ist just the first sub-/supscript token. |
1286 |
//! Of course 'CurToken' is just the first sub-/supscript token. |
1277 |
//! It should be of no further interest. The positions of the |
1287 |
//! It should be of no further interest. The positions of the |
1278 |
//! sub-/supscripts will be identified by the corresponding subnodes |
1288 |
//! sub-/supscripts will be identified by the corresponding subnodes |
1279 |
//! index in the 'aSubNodes' array (enum value from 'SmSubSup'). |
1289 |
//! index in the 'aSubNodes' array (enum value from 'SmSubSup'). |
Lines 1409-1414
void SmParser::Term()
Link Here
|
1409 |
Blank(); |
1419 |
Blank(); |
1410 |
break; |
1420 |
break; |
1411 |
|
1421 |
|
|
|
1422 |
case TNOSPACE : |
1423 |
NodeStack.Push(new SmExpressionNode(CurToken)); |
1424 |
NextToken(); |
1425 |
if (CurToken.eType != TLGROUP) |
1426 |
{ NodeStack.Pop(); |
1427 |
Term(); |
1428 |
} |
1429 |
else // _almost_ the same as in TLGROUP |
1430 |
{ NextToken(); |
1431 |
// allow for empty group |
1432 |
if (CurToken.eType == TRGROUP) |
1433 |
{ NodeStack.Pop(); |
1434 |
SmStructureNode *pSNode = new SmExpressionNode(CurToken); |
1435 |
pSNode->SetSubNodes(NULL, NULL); |
1436 |
NodeStack.Push(pSNode); |
1437 |
|
1438 |
NextToken(); |
1439 |
} |
1440 |
else // go as usual |
1441 |
{ Align(); |
1442 |
if (CurToken.eType != TRGROUP) |
1443 |
Error(PE_RGROUP_EXPECTED); |
1444 |
else |
1445 |
{ NextToken(); |
1446 |
} |
1447 |
} |
1448 |
} |
1449 |
break; |
1450 |
|
1412 |
case TTEXT : |
1451 |
case TTEXT : |
1413 |
NodeStack.Push(new SmTextNode(CurToken, FNT_TEXT)); |
1452 |
NodeStack.Push(new SmTextNode(CurToken, FNT_TEXT)); |
1414 |
NextToken(); |
1453 |
NextToken(); |