VirtualBox

Changeset 105760 in vbox


Ignore:
Timestamp:
Aug 21, 2024 12:15:14 PM (3 months ago)
Author:
vboxsync
Message:

Runtime/script: Add a simple lexer API to turn a stream of characters into tokens for a defined configuration, bugref:10394 [scm]

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/script.h

    r105757 r105760  
    368368 * @param   pCfg                   The lexer config to use for identifying the different tokens.
    369369 */
    370 RTDECL(int) RTScriptLexCreateFromReader(PRTSCRIPTLEX phScriptLex, PFNRTSCRIPTLEXRDR pfnReader, 
     370RTDECL(int) RTScriptLexCreateFromReader(PRTSCRIPTLEX phScriptLex, PFNRTSCRIPTLEXRDR pfnReader,
    371371                                        PFNRTSCRIPTLEXDTOR pfnDtor, void *pvUser,
    372372                                        size_t cchBuf, PRTSTRCACHE phStrCacheId, PRTSTRCACHE phStrCacheStringLit,
  • trunk/src/VBox/Runtime/common/script/scriptlex.cpp

    r105753 r105760  
    55
    66/*
    7  * Copyright (C) 2017 Oracle Corporation
    8  *
    9  * This file is part of VirtualBox Open Source Edition (OSE), as
    10  * available from http://www.virtualbox.org. This file is free software;
    11  * you can redistribute it and/or modify it under the terms of the GNU
    12  * General Public License (GPL) as published by the Free Software
    13  * Foundation, in version 2 as it comes in the "COPYING" file of the
    14  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
    15  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     7 * Copyright (C) 2022-2023 Oracle and/or its affiliates.
     8 *
     9 * This file is part of VirtualBox base platform packages, as
     10 * available from https://www.virtualbox.org.
     11 *
     12 * This program is free software; you can redistribute it and/or
     13 * modify it under the terms of the GNU General Public License
     14 * as published by the Free Software Foundation, in version 3 of the
     15 * License.
     16 *
     17 * This program is distributed in the hope that it will be useful, but
     18 * WITHOUT ANY WARRANTY; without even the implied warranty of
     19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     20 * General Public License for more details.
     21 *
     22 * You should have received a copy of the GNU General Public License
     23 * along with this program; if not, see <https://www.gnu.org/licenses>.
    1624 *
    1725 * The contents of this file may alternatively be used under the terms
    1826 * of the Common Development and Distribution License Version 1.0
    19  * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
    20  * VirtualBox OSE distribution, in which case the provisions of the
     27 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
     28 * in the VirtualBox distribution, in which case the provisions of the
    2129 * CDDL are applicable instead of those of the GPL.
    2230 *
    2331 * You may elect to license modified versions of this file under the
    2432 * terms and conditions of either the GPL or the CDDL or both.
     33 *
     34 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
    2535 */
    2636
     
    2939*   Header Files                                                                                                                 *
    3040*********************************************************************************************************************************/
    31 #define LOG_GROUP RTLOGGROUP_DEFAULT // @todo
     41#define LOG_GROUP RTLOGGROUP_DEFAULT /// @todo
    3242#include <iprt/script.h>
    3343
     
    155165 * @param   psz                    The string to match against.
    156166 * @param   pszExclude             When the string matched but the input continues
    157  *                                 with one of the characters in this string the
    158  *                                 match will not
     167 *                                 with one of the characters in this string there will
     168 *                                 be no match.
    159169 */
    160170DECLINLINE(bool) rtScriptLexMatchStrConsume(PRTSCRIPTLEXINT pThis, char ch, const char *psz,
     
    300310                continue;
    301311
    302             /** @todo: Not quite correct when there is an end of stream before the closing lexeme.
     312            /** @todo Not quite correct when there is an end of stream before the closing lexeme.
    303313             * But doesn't hurt at the moment. */
    304314            if (   chTmp == '\0'
     
    576586    if (RT_LIKELY(pThis))
    577587    {
    578         pThis->u32Magic     = 0xfefecafe; /**@todo */
     588        pThis->u32Magic     = 0xfefecafe; /** @todo */
    579589        pThis->Pos.iLine    = 1;
    580590        pThis->Pos.iCh      = 1;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette