Skip to content

Parser 구현 #8

Description

@gdtknight

✨ AST (abstract sytax tree) 생성을 위한 Parser 구현

  • Node 기본 구조체

    typedef struct s_syntax_node
    {
        enum  e_node_type
        {
            NODE_LIST,
            NODE_PIPELINE,
            // ...
        } type;
        union u_node_value
        {
            char *word;
            struct s_syntax_node child;
            struct s_binary_operator
            {
                char                 *op;
                struct s_syntax_node *left;
                struct s_syntax_node *right;
            };
            // ...
        } value;
    } t_syntax_node;
  • Node Type 마다 생성 함수 작성

    • list
    • and_or
    • pipeline
    • command
    • cmd_prefix
    • cmd_word
    • cmd_suffix
    • io_redir
    • assignment_word
    • word

📝 추가 정보 (선택)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions