Changeset 44842 in vbox for trunk/src/VBox/Storage/testcase
- Timestamp:
- Feb 27, 2013 12:40:44 PM (12 years ago)
- Location:
- trunk/src/VBox/Storage/testcase
- Files:
-
- 3 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/testcase/VDScript.cpp
r44840 r44842 51 51 #include <VBox/log.h> 52 52 53 #include "VDScript.h"54 53 #include "VDScriptAst.h" 54 #include "VDScriptInternal.h" 55 55 56 56 /** … … 181 181 PVDSCRIPTTOKEN pTokenNext; 182 182 } VDTOKENIZER; 183 /** Pointer to a tokenize state. */184 typedef struct VDTOKENIZER *PVDTOKENIZER;185 183 186 184 /** … … 220 218 } VDSCRIPTFN; 221 219 typedef VDSCRIPTFN *PVDSCRIPTFN; 222 223 /**224 * Script context.225 */226 typedef struct VDSCRIPTCTXINT227 {228 /** String space of external registered and source defined functions. */229 RTSTRSPACE hStrSpaceFn;230 /** List of ASTs for functions - VDSCRIPTASTFN. */231 RTLISTANCHOR ListAst;232 /** Pointer to the current tokenizer state. */233 PVDTOKENIZER pTokenizer;234 } VDSCRIPTCTXINT;235 /** Pointer to a script context. */236 typedef VDSCRIPTCTXINT *PVDSCRIPTCTXINT;237 220 238 221 /** … … 512 495 ch = vdScriptTokenizerGetCh(pTokenizer); 513 496 } 514 while (RT_C_IS_ALNUM(ch) );497 while (RT_C_IS_ALNUM(ch) || ch == '_'); 515 498 516 499 /* Check whether we got an identifier or an reserved keyword. */ … … 950 933 int rc = VINF_SUCCESS; 951 934 935 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 936 952 937 if (vdScriptTokenizerSkipIfIsPunctuatorEqual(pThis->pTokenizer, '(')) 953 938 { … … 1001 986 } 1002 987 988 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1003 989 return rc; 1004 990 } … … 1016 1002 PVDSCRIPTASTEXPR pExpr = NULL; 1017 1003 1004 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1005 1018 1006 rc = vdScriptParseAssignmentExpression(pThis, &pExpr); 1019 1007 if (RT_SUCCESS(rc)) … … 1033 1021 } 1034 1022 1023 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1035 1024 return rc; 1036 1025 } … … 1054 1043 int rc = VINF_SUCCESS; 1055 1044 PVDSCRIPTASTEXPR pExpr = NULL; 1045 1046 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1056 1047 1057 1048 rc = vdScriptParsePrimaryExpression(pThis, &pExpr); … … 1113 1104 vdScriptAstNodeFree(&pExpr->Core); 1114 1105 } 1106 1107 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1115 1108 return rc; 1116 1109 } … … 1139 1132 PVDSCRIPTASTEXPR pExprTop = NULL; 1140 1133 1134 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1135 1141 1136 while (true) 1142 1137 { 1138 bool fQuit = false; 1143 1139 PVDSCRIPTASTEXPR pExprNew = NULL; 1144 1140 … … 1195 1191 /* Must be a postfix expression. */ 1196 1192 rc = vdScriptParsePostfixExpression(pThis, &pExprNew); 1193 fQuit = true; 1197 1194 } 1198 1195 … … 1209 1206 pExpr = pExprNew; 1210 1207 } 1208 if (fQuit) 1209 break; 1211 1210 } 1212 1211 else … … 1219 1218 vdScriptAstNodeFree(&pExprTop->Core); 1220 1219 1220 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1221 1221 return rc; 1222 1222 } … … 1241 1241 PVDSCRIPTASTEXPR pExpr = NULL; 1242 1242 1243 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1244 1243 1245 rc = vdScriptParseUnaryExpression(pThis, &pExpr); 1244 1246 if (RT_SUCCESS(rc)) … … 1286 1288 vdScriptAstNodeFree(&pExpr->Core); 1287 1289 } 1290 1291 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1288 1292 return rc; 1289 1293 } … … 1307 1311 PVDSCRIPTASTEXPR pExpr = NULL; 1308 1312 1313 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1314 1309 1315 rc = vdScriptParseMultiplicativeExpression(pThis, &pExpr); 1310 1316 if (RT_SUCCESS(rc)) … … 1344 1350 vdScriptAstNodeFree(&pExpr->Core); 1345 1351 } 1352 1353 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1346 1354 return rc; 1347 1355 } … … 1365 1373 PVDSCRIPTASTEXPR pExpr = NULL; 1366 1374 1375 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1376 1367 1377 rc = vdScriptParseAdditiveExpression(pThis, &pExpr); 1368 1378 if (RT_SUCCESS(rc)) … … 1402 1412 vdScriptAstNodeFree(&pExpr->Core); 1403 1413 } 1414 1415 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1404 1416 return rc; 1405 1417 } … … 1425 1437 PVDSCRIPTASTEXPR pExpr = NULL; 1426 1438 1439 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1440 1427 1441 rc = vdScriptParseShiftExpression(pThis, &pExpr); 1428 1442 if (RT_SUCCESS(rc)) … … 1478 1492 vdScriptAstNodeFree(&pExpr->Core); 1479 1493 } 1494 1495 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1480 1496 return rc; 1481 1497 } … … 1499 1515 PVDSCRIPTASTEXPR pExpr = NULL; 1500 1516 1517 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1518 1501 1519 rc = vdScriptParseRelationalExpression(pThis, &pExpr); 1502 1520 if (RT_SUCCESS(rc)) … … 1536 1554 vdScriptAstNodeFree(&pExpr->Core); 1537 1555 } 1556 1557 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1538 1558 return rc; 1539 1559 } … … 1555 1575 int rc = VINF_SUCCESS; 1556 1576 PVDSCRIPTASTEXPR pExpr = NULL; 1577 1578 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1557 1579 1558 1580 rc = vdScriptParseEqualityExpression(pThis, &pExpr); … … 1582 1604 vdScriptAstNodeFree(&pExpr->Core); 1583 1605 } 1606 1607 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1584 1608 return rc; 1585 1609 } … … 1601 1625 int rc = VINF_SUCCESS; 1602 1626 PVDSCRIPTASTEXPR pExpr = NULL; 1627 1628 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1603 1629 1604 1630 rc = vdScriptParseBitwiseAndExpression(pThis, &pExpr); … … 1628 1654 vdScriptAstNodeFree(&pExpr->Core); 1629 1655 } 1656 1657 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1630 1658 return rc; 1631 1659 } … … 1647 1675 int rc = VINF_SUCCESS; 1648 1676 PVDSCRIPTASTEXPR pExpr = NULL; 1677 1678 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1649 1679 1650 1680 rc = vdScriptParseBitwiseXorExpression(pThis, &pExpr); … … 1674 1704 vdScriptAstNodeFree(&pExpr->Core); 1675 1705 } 1706 1707 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1676 1708 return rc; 1677 1709 } … … 1693 1725 int rc = VINF_SUCCESS; 1694 1726 PVDSCRIPTASTEXPR pExpr = NULL; 1727 1728 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1695 1729 1696 1730 rc = vdScriptParseBitwiseOrExpression(pThis, &pExpr); … … 1720 1754 vdScriptAstNodeFree(&pExpr->Core); 1721 1755 } 1756 1757 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1722 1758 return rc; 1723 1759 } … … 1739 1775 int rc = VINF_SUCCESS; 1740 1776 PVDSCRIPTASTEXPR pExpr = NULL; 1777 1778 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1741 1779 1742 1780 rc = vdScriptParseLogicalAndExpression(pThis, &pExpr); … … 1766 1804 vdScriptAstNodeFree(&pExpr->Core); 1767 1805 } 1806 1807 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1768 1808 return rc; 1769 1809 } … … 1800 1840 int rc = VINF_SUCCESS; 1801 1841 PVDSCRIPTASTEXPR pExpr; 1842 1843 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1802 1844 1803 1845 rc = vdScriptParseLogicalOrExpression(pThis, &pExpr); … … 1910 1952 vdScriptAstNodeFree(&pExpr->Core); 1911 1953 } 1954 1955 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1912 1956 return rc; 1913 1957 } … … 1929 1973 int rc = VINF_SUCCESS; 1930 1974 PVDSCRIPTASTEXPR pAssignExpr = NULL; 1975 1976 LogFlowFunc(("pThis=%p ppAstNodeExpr=%p\n")); 1931 1977 1932 1978 rc = vdScriptParseAssignmentExpression(pThis, &pAssignExpr); … … 1959 2005 *ppAstNodeExpr = pAssignExpr; 1960 2006 2007 LogFlowFunc(("returns rc=%Rrc\n", rc)); 1961 2008 return rc; 1962 2009 } … … 2434 2481 pAstNodeFn->pFnIde = pFnIde; 2435 2482 pAstNodeFn->pRetType = pRetType; 2483 RTListInit(&pAstNodeFn->ListArgs); 2436 2484 2437 2485 pFnIde = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.