Kyopro Library
 
読み取り中…
検索中…
一致する文字列を見つけられません
exp_AHC.Expander クラス

Expander class is responsible for expanding libraries in the source code. [詳解]

公開メンバ関数

bool is_ignored_line (self, line)
 Checks if a line should be ignored during expansion.
 
 __init__ (self, List[Path] lib_paths)
 Initializes an Expander object.
 
Path find_library (self, str library_name)
 Finds the path of a library file.
 
List[str] expand_library (self, Path library_file_path)
 Expands a library file.
 
str expand (self, str source)
 Expands libraries in the source code.
 

公開変数類

 lib_paths = lib_paths
 

静的公開変数類

 include = re.compile(r'#include\s*["<](kyopro_library/[a-z0-9_/]*(|.hpp))[">]\s*')
 
 included = set()
 

詳解

Expander class is responsible for expanding libraries in the source code.

Attributes:

  • include (re.Pattern): Regular expression pattern to match include statements.
  • lib_paths (List[Path]): List of library paths.
  • included (Set[Path]): Set of included library file paths.

Methods:

  • is_ignored_line(line: str) -> bool: Checks if a line should be ignored during expansion.
  • find_library(library_name: str) -> Path: Finds the path of a library file.
  • expand_library(library_file_path: Path) -> List[str]: Expands a library file.
  • expand(source: str) -> str: Expands libraries in the source code.

exp_AHC.py21 行目に定義があります。

構築子と解体子

◆ __init__()

exp_AHC.Expander.__init__ ( self,
List[Path] lib_paths )

Initializes an Expander object.

Args:

  • lib_paths (List[Path]): List of library paths.

exp_AHC.py67 行目に定義があります。

関数詳解

◆ is_ignored_line()

bool exp_AHC.Expander.is_ignored_line ( self,
line )

Checks if a line should be ignored during expansion.

Args:

  • line (str): The line to be checked.

Returns:

  • bool: True if the line should be ignored, False otherwise.

exp_AHC.py40 行目に定義があります。

◆ find_library()

Path exp_AHC.Expander.find_library ( self,
str library_name )

Finds the path of a library file.

Args:

  • library_name (str): The name of the library file.

Returns:

  • Path: The path of the library file.

Raises:

  • FileNotFoundError: If the library file cannot be found.

exp_AHC.py79 行目に定義があります。

参照先 exp_AHC.format, exp.Expander.lib_paths, lib_paths.

◆ expand_library()

List[str] exp_AHC.Expander.expand_library ( self,
Path library_file_path )

Expands a library file.

Args:

  • library_file_path (Path): The path of the library file.

Returns:

  • List[str]: The expanded lines of the library file.

exp_AHC.py100 行目に定義があります。

参照先 exp.Expander.expand_library(), expand_library(), exp.Expander.find_library(), find_library(), exp_AHC.format, exp.Expander.include, include, exp.Expander.included, included, exp.Expander.is_ignored_line(), is_ignored_line().

◆ expand()

str exp_AHC.Expander.expand ( self,
str source )

Expands libraries in the source code.

Args:

  • source (str): The source code to be expanded.

Returns:

  • str: The expanded source code.

exp_AHC.py145 行目に定義があります。

参照先 exp.Expander.expand_library(), expand_library(), exp.Expander.find_library(), find_library(), exp.Expander.include, include, exp.Expander.included, included.

メンバ詳解

◆ include

exp_AHC.Expander.include = re.compile(r'#include\s*["<](kyopro_library/[a-z0-9_/]*(|.hpp))[">]\s*')
static

exp_AHC.py38 行目に定義があります。

◆ included

exp_AHC.Expander.included = set()
static

exp_AHC.py77 行目に定義があります。

◆ lib_paths

exp_AHC.Expander.lib_paths = lib_paths

exp_AHC.py75 行目に定義があります。


このクラス詳解は次のファイルから抽出されました: