Class l2df.class.parser

Last updated 2021-05-28 15:24:22

Base class for parsers.

Inherited from l2df.Class.

Info:

Functions

Parser:parseFile(filepath[, obj]) Base method for parsing file.
Parser:parse(str[, obj]) Base method for parsing string.
Parser:parseScalar(str) Method that tries to deduce type for given string.
Parser:dumpScalar(value) Method for converting scalar value to string.
Parser:dumpToFile(filepath, data) Base method for dumping table to file.
Parser:dump(data) Base method for dumping table.


Functions

Methods
Parser:parseFile(filepath[, obj])
Base method for parsing file. You can extend existing object by passing it as second parameter.

Parameters:

  • filepath string Path to file for parsing.
  • obj table Object to extend. (optional)

Returns:

    table
Parser:parse(str[, obj])
Base method for parsing string. You can extend existing object by passing it as second parameter.

Parameters:

  • str string String for parsing.
  • obj table Object to extend. (optional)

Returns:

    table
Parser:parseScalar(str)
Method that tries to deduce type for given string. Returns casted value.

Parameters:

  • str string String for parsing.

Returns:

    mixed
Parser:dumpScalar(value)
Method for converting scalar value to string.

Parameters:

  • value string Value for dumping.

Returns:

    string
Parser:dumpToFile(filepath, data)
Base method for dumping table to file.

Parameters:

  • filepath string Path to file for dumping.
  • data table Table for dumping.

Returns:

    table
Parser:dump(data)
Base method for dumping table.

Parameters:

  • data table Table for dumping.

Returns:

    string