Ignore:
Timestamp:
05/01/23 02:14:27 (12 months ago)
Author:
Maciej Komosinski
Message:

Got rid of the (buggy) look-ahead function, made parsing stricter and simpler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/f4/f4_general.h

    r1229 r1230  
    4040#define CELL_NEURON 42 ///<differentiated to neuron, can divide
    4141//@}
    42 
    43 /**
    44  * TODO MacKo 2023-04: not sure if this function is needed and if f4_processRecur() would not suffice
    45  * if it advanced the string pointer (in/out parameter) while processing. Its returned value is always used after
    46  * f4_processRecur() anyway, and in two cases likely incorrectly (for [...] to detect closing ']'
    47  * and for :...: to detect closing ':') - we don't need recursion in these cases, a simple linear
    48  * scan would suffice, but even this would not be needed - since we are parsing the actual characters in these cases,
    49  * we do scanning anyway. So looks like this function doubles the work already done more thoroughly by f4_processRecur().
    50  *
    51  * Scans f4 genotype string for a stopping character and returns the position of
    52  * this stopping character or 1 if the end of string was reached. This method is used
    53  * for closing braces, like ), >, ]. It runs recursively when opening braces
    54  * like (, <, # are found.
    55  * @param s string with the f4 genotype
    56  * @param slen length of a given string
    57  * @param stopchar character to be found
    58  * @return 1 if end of string was reached, or position of found character in sequence
    59  */
    60 int scanRecur(const char* s, int slen, char stopchar);
    6142
    6243
     
    501482 * @return 0 if processing was successful, otherwise returns the position of an error in the genotype
    502483 */
    503 int f4_processRecur(const char *genot, unsigned int pos0, f4_Node *parent);
     484int f4_processRecur(const char *genot, int &pos_inout, f4_Node *parent);
    504485
    505486/**
Note: See TracChangeset for help on using the changeset viewer.