diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ad549c..b45c692 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -162,6 +162,7 @@
     src/tree_schema_compile.c
     src/tree_schema_helpers.c
     src/parser_yang.c
+    src/parser_yin.c
     src/xml.c
     src/xpath.c)
 
diff --git a/src/parser_yin.c b/src/parser_yin.c
new file mode 100644
index 0000000..e8b0333
--- /dev/null
+++ b/src/parser_yin.c
@@ -0,0 +1,319 @@
+/**
+ * @file parser_yin.c
+ * @author David Sedlák <xsedla1d@stud.fit.vutbr.cz>
+ * @brief YIN parser.
+ *
+ * Copyright (c) 2015 - 2018 CESNET, z.s.p.o.
+ *
+ * This source code is licensed under BSD 3-Clause License (the "License").
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://opensource.org/licenses/BSD-3-Clause
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include "common.h"
+#include "context.h"
+#include "libyang.h"
+#include "xml.h"
+#include "tree_schema_internal.h"
+
+enum YIN_ARGUMENT {
+    YIN_ARG_NONE = 0,
+    YIN_ARG_NAME,
+    YIN_ARG_TARGET_NODE,
+    YIN_ARG_MODULE,
+    YIN_ARG_VALUE,
+    YIN_ARG_TEXT,
+    YIN_ARG_CONDITION,
+    YIN_ARG_URI,
+    YIN_ARG_DATE,
+    YIN_ARG_TAG,
+};
+
+enum YIN_ARGUMENT
+match_argument_name(const char *name, size_t len)
+{
+    enum YIN_ARGUMENT arg = YIN_ARG_NONE;
+    size_t already_read = 0;
+
+#define MOVE_DATA(DATA, COUNT) already_read+=COUNT;
+#define IF_ARG(STR, LEN, STMT) if (!strncmp((name) + already_read, STR, LEN)) {MOVE_DATA(name, LEN);arg=STMT;}
+#define IF_ARG_PREFIX(STR, LEN) if (!strncmp((name) + already_read, STR, LEN)) {MOVE_DATA(name, LEN);
+#define IF_ARG_PREFIX_END }
+
+    switch(*name) {
+        case 'c':
+            MOVE_DATA(name, 1);
+            IF_ARG("ondition", 8, YIN_ARG_CONDITION);
+        break;
+
+        case 'd':
+            MOVE_DATA(name, 1);
+            IF_ARG("ate", 3, YIN_ARG_DATE);
+        break;
+
+        case 'm':
+            MOVE_DATA(name, 1);
+            IF_ARG("odule", 5, YIN_ARG_MODULE);
+        break;
+
+        case 'n':
+            MOVE_DATA(name, 1);
+            IF_ARG("ame", 3, YIN_ARG_NAME);
+        break;
+
+        case 't':
+            MOVE_DATA(name, 1);
+            IF_ARG_PREFIX("a", 1)
+                IF_ARG("g", 1, YIN_ARG_TAG)
+                else IF_ARG("rget-node", 9, YIN_ARG_TARGET_NODE)
+            IF_ARG_PREFIX_END
+            else IF_ARG("ext", 3, YIN_ARG_TEXT)
+        break;
+
+        case 'u':
+            MOVE_DATA(name, 1);
+            IF_ARG("ri", 2, YIN_ARG_URI)
+        break;
+
+        case 'v':
+            MOVE_DATA(name, 1);
+            IF_ARG("alue", 4, YIN_ARG_VALUE);
+        break;
+    }
+
+    /* whole argument must be matched */
+    if (already_read != len) {
+        arg = YIN_ARG_NONE;
+    }
+
+    return arg;
+}
+
+LY_ERR
+parser_belongs_to(struct lyxml_context *xml_ctx, const char **data, const char **belongsto, const char **prefix, struct lysp_ext **extensions)
+{
+    enum yang_keyword kw = YANG_NONE;
+    LY_ERR ret = LY_SUCCESS;
+    const char *prefix_out, *name;
+    size_t prefix_len, name_len;
+
+    char *buf = NULL, *out = NULL;
+    size_t buf_len = 0, out_len = 0;
+    int dynamic;
+
+    /* check if belongs-to has argument module */
+    ret = lyxml_get_attribute(xml_ctx, data, &prefix_out, &prefix_len, &name, &name_len);
+    LY_CHECK_RET1(ret);
+    if (match_argument_name(name, name_len) != YIN_ARG_MODULE) {
+        LOGVAL(xml_ctx->ctx, LY_VLOG_LINE, &xml_ctx->line, LYVE_SYNTAX, "Invalid argument name \"%s\", expected \"module\".", name);
+        return LY_EINVAL;
+    }
+
+    /* read content of argument */
+    ret = lyxml_get_string(xml_ctx, data, &buf, &buf_len, &out, &out_len, &dynamic);
+    LY_CHECK_RET1(ret);
+    *belongsto = lydict_insert(xml_ctx->ctx, out, out_len);
+    LY_CHECK_ERR_RET(!belongsto, LOGMEM(xml_ctx->ctx), LY_EMEM);
+
+    /* read substatements */
+    while (xml_ctx->status == LYXML_ATTRIBUTE) {
+        ret = lyxml_get_attribute(xml_ctx, data, &prefix_out, &prefix_len, &name, &name_len);
+        LY_CHECK_ERR_RET(ret != LY_SUCCESS, LOGMEM(xml_ctx->ctx), ret);
+        kw = match_keyword(name);
+
+        switch (kw) {
+        case YANG_PREFIX:
+            ret = lyxml_get_string(xml_ctx, data, &buf, &buf_len, &out, &out_len, &dynamic);
+            *prefix = lydict_insert(xml_ctx->ctx, out, out_len);
+            break;
+        case YANG_CUSTOM:
+            /* TODO parse extension */
+            break;
+        default:
+            LOGVAL(xml_ctx->ctx, LY_VLOG_LINE, &xml_ctx->line, LYVE_SYNTAX, "Unexpected attribute");
+            return LY_EVALID;
+        }
+    }
+
+    if (!prefix) {
+        LOGVAL(xml_ctx->ctx, LY_VLOG_LINE, &xml_ctx->line, LYVE_SYNTAX, "Missing prefix");
+        return LY_EVALID;
+    }
+
+    return LY_SUCCESS;
+}
+
+LY_ERR
+parse_namespace(struct lyxml_context *xml_ctx, const char **data, struct lysp_module **mod_p)
+{
+    LY_ERR ret = LY_SUCCESS;
+    const char *prefix, *name;
+    size_t prefix_len, name_len;
+
+    char *buf = NULL, *out = NULL;
+    size_t buf_len = 0, out_len = 0;
+    int dynamic;
+
+    /* check if namespace has argument uri */
+    ret = lyxml_get_attribute(xml_ctx, data, &prefix, &prefix_len, &name, &name_len);
+    LY_CHECK_RET1(ret);
+    if (match_argument_name(name, name_len) != YIN_ARG_URI) {
+        LOGVAL(xml_ctx->ctx, LY_VLOG_LINE, &xml_ctx->line, LYVE_SYNTAX, "Invalid argument name \"%s\", expected \"uri\".", name);
+        return LY_EVALID;
+    }
+
+    ret = lyxml_get_string(xml_ctx, data, &buf, &buf_len, &out, &out_len, &dynamic);
+    LY_CHECK_RET1(ret);
+    (*mod_p)->ns = lydict_insert(xml_ctx->ctx, out, out_len);
+    LY_CHECK_ERR_RET(!(*mod_p)->ns, LOGMEM(xml_ctx->ctx), LY_EMEM);
+
+    /* namespace can only have one argument */
+    ret = lyxml_get_attribute(xml_ctx, data, &prefix, &prefix_len, &name, &name_len);
+    LY_CHECK_RET1(ret);
+    if (name) {
+        LOGVAL(xml_ctx->ctx, LY_VLOG_LINE, &xml_ctx->line, LYVE_SYNTAX, "Unexpected argument \"%s\".", name);
+        return LY_EVALID;
+    }
+
+    return LY_SUCCESS;
+}
+
+LY_ERR
+parse_prefix(struct lyxml_context *xml_ctx, const char **data, struct lysp_module **mod_p)
+{
+    LY_ERR ret = LY_SUCCESS;
+    const char *prefix, *name;
+    size_t prefix_len, name_len;
+
+    char *buf = NULL, *out = NULL;
+    size_t buf_len = 0, out_len = 0;
+    int dynamic;
+
+    /* check if prefix has argument value */
+    ret = lyxml_get_attribute(xml_ctx, data, &prefix, &prefix_len, &name, &name_len);
+    LY_CHECK_RET1(ret);
+    if (match_argument_name(name, name_len) != YIN_ARG_VALUE) {
+        LOGVAL(xml_ctx->ctx, LY_VLOG_LINE, &xml_ctx->line, LYVE_SYNTAX, "Invalid argument name \"%s\", expected \"value\".", name);
+        return LY_EVALID;
+    }
+
+    ret = lyxml_get_string(xml_ctx, data, &buf, &buf_len, &out, &out_len, &dynamic);
+    LY_CHECK_RET1(ret);
+    (*mod_p)->prefix = lydict_insert(xml_ctx->ctx, out, out_len);
+    LY_CHECK_ERR_RET(!(*mod_p)->prefix, LOGMEM(xml_ctx->ctx), LY_EMEM);
+
+    /* prefix element can only have one argument */
+    ret = lyxml_get_attribute(xml_ctx, data, &prefix, &prefix_len, &name, &name_len);
+    LY_CHECK_RET1(ret);
+    if (name) {
+        LOGVAL(xml_ctx->ctx, LY_VLOG_LINE, &xml_ctx->line, LYVE_SYNTAX, "Unexpected argument \"%s\".", name);
+        return LY_EVALID;
+    }
+    return LY_SUCCESS;
+}
+
+LY_ERR
+parse_submodule(struct lyxml_context *xml_ctx, const char **data, struct lysp_module **mod_p)
+{
+    LY_ERR ret = LY_SUCCESS;
+    enum yang_keyword kw = YANG_NONE;
+    const char *prefix, *name;
+    size_t prefix_len, name_len;
+
+    char *buf = NULL, *out = NULL;
+    size_t buf_len = 0, out_len = 0;
+    int dynamic;
+
+    /* check if module/submodule has argument "name" */
+    ret = lyxml_get_attribute(xml_ctx, data, &prefix, &prefix_len, &name, &name_len);
+    LY_CHECK_ERR_RET(ret != LY_SUCCESS, LOGMEM(xml_ctx->ctx), LY_EMEM);
+    if (match_argument_name(name, name_len) != YIN_ARG_NAME) {
+        LOGVAL(xml_ctx->ctx, LY_VLOG_LINE, &xml_ctx->line, LYVE_SYNTAX, "Invalid argument name \"%s\", expected \"name\".", name);
+    }
+
+    /* read module name */
+    if (xml_ctx->status != LYXML_ATTR_CONTENT) {
+        LOGVAL(xml_ctx->ctx, LY_VLOG_LINE, &xml_ctx->line, LYVE_SYNTAX, "Missing value of argument \"name\"");
+    }
+    ret = lyxml_get_string(xml_ctx, data, &buf, &buf_len, &out, &out_len, &dynamic);
+    LY_CHECK_ERR_RET(ret != LY_SUCCESS, LOGMEM(xml_ctx->ctx), LY_EMEM);
+    (*mod_p)->name = lydict_insert(xml_ctx->ctx, out, out_len);
+    LY_CHECK_ERR_RET(!(*mod_p)->name, LOGMEM(xml_ctx->ctx), LY_EMEM);
+
+    /* read all attributes and their content only for testing */
+    while (xml_ctx->status == LYXML_ATTRIBUTE) {
+        lyxml_get_attribute(xml_ctx, data, &prefix, &prefix_len, &name, &name_len);
+        while (xml_ctx->status == LYXML_ATTR_CONTENT) {
+            lyxml_get_string(xml_ctx, data, &buf, &buf_len, &out, &out_len, &dynamic);
+        }
+    }
+
+
+    while (xml_ctx->status == LYXML_ELEMENT || xml_ctx->status == LYXML_ELEM_CONTENT) {
+        ret = lyxml_get_element(xml_ctx, data, &prefix, &prefix_len, &name, &name_len);
+        LY_CHECK_ERR_RET(ret != LY_SUCCESS, LOGMEM(xml_ctx->ctx), LY_EMEM);
+        kw = match_keyword(name);
+
+        switch (kw) {
+            case YANG_NAMESPACE:
+                ret = parse_namespace(xml_ctx, data, mod_p);
+            break;
+            case YANG_PREFIX:
+                ret = parse_prefix(xml_ctx, data, mod_p);
+                /* TODO change lysp_check_prefix function to work with ctx and not parser_ctx */
+                //LY_CHECK_RET(lysp_check_prefix(&xml_ctx->ctx, *mod_p, &((*mod_p)->prefix)), LY_EVALID);
+            break;
+            case YANG_BELONGS_TO:
+                ret = parser_belongs_to(xml_ctx, data, &(*mod_p)->belongsto, &(*mod_p)->prefix, &(*mod_p)->extensions);
+            break;
+
+            default:
+                /* error */
+            break;
+        }
+    }
+
+    return ret;
+}
+
+LY_ERR
+yin_parse(struct ly_ctx *ctx, const char *data, struct lysp_module **mod_p)
+{
+    LY_ERR ret = LY_SUCCESS;
+    enum yang_keyword kw = YANG_NONE;
+    struct lyxml_context xml_ctx;
+
+    memset(&xml_ctx, 0, sizeof xml_ctx);
+    xml_ctx.ctx = ctx;
+    xml_ctx.line = 1;
+
+    const char *prefix, *name;
+    size_t prefix_len, name_len;
+
+    /* check if root element is module or submodule */
+    ret = lyxml_get_element(&xml_ctx, &data, &prefix, &prefix_len, &name, &name_len);
+    LY_CHECK_GOTO(ret != LY_SUCCESS, error);
+    kw = match_keyword(name);
+    if (kw != YANG_MODULE && kw != YANG_SUBMODULE) {
+        LOGVAL(xml_ctx.ctx, LY_VLOG_LINE, &xml_ctx.line, LYVE_SYNTAX, "Invalid keyword \"%s\", expected \"module\" or \"submodule\".", name);
+    }
+
+    if (kw == YANG_SUBMODULE) {
+        (*mod_p)->submodule = 1;
+    }
+
+    ret = parse_submodule(&xml_ctx, &data, mod_p);
+
+    lyxml_context_clear(&xml_ctx);
+    return ret;
+
+error:
+    lyxml_context_clear(&xml_ctx);
+    return ret;
+}
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index 20a06dc..74e950d 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -1147,3 +1147,198 @@
     return NULL;
 }
 
+enum yang_keyword
+match_keyword(const char *data)
+{
+/* TODO make this function usable in get_keyword function */
+#define MOVE_IN(DATA, COUNT) (data)+=COUNT;
+#define IF_KEYWORD(STR, LEN, STMT) if (!strncmp((data), STR, LEN)) {MOVE_IN(data, LEN);kw=STMT;}
+#define IF_KEYWORD_PREFIX(STR, LEN) if (!strncmp((data), STR, LEN)) {MOVE_IN(data, LEN);
+#define IF_KEYWORD_PREFIX_END }
+
+    enum yang_keyword kw = YANG_NONE;
+    /* read the keyword itself */
+    switch (*data) {
+    case 'a':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("rgument", 7, YANG_ARGUMENT)
+        else IF_KEYWORD("ugment", 6, YANG_AUGMENT)
+        else IF_KEYWORD("ction", 5, YANG_ACTION)
+        else IF_KEYWORD_PREFIX("ny", 2)
+            IF_KEYWORD("data", 4, YANG_ANYDATA)
+            else IF_KEYWORD("xml", 3, YANG_ANYXML)
+        IF_KEYWORD_PREFIX_END
+        break;
+    case 'b':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("ase", 3, YANG_BASE)
+        else IF_KEYWORD("elongs-to", 9, YANG_BELONGS_TO)
+        else IF_KEYWORD("it", 2, YANG_BIT)
+        break;
+    case 'c':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("ase", 3, YANG_CASE)
+        else IF_KEYWORD("hoice", 5, YANG_CHOICE)
+        else IF_KEYWORD_PREFIX("on", 2)
+            IF_KEYWORD("fig", 3, YANG_CONFIG)
+            else IF_KEYWORD_PREFIX("ta", 2)
+                IF_KEYWORD("ct", 2, YANG_CONTACT)
+                else IF_KEYWORD("iner", 4, YANG_CONTAINER)
+            IF_KEYWORD_PREFIX_END
+        IF_KEYWORD_PREFIX_END
+        break;
+    case 'd':
+        MOVE_IN(data, 1);
+        IF_KEYWORD_PREFIX("e", 1)
+            IF_KEYWORD("fault", 5, YANG_DEFAULT)
+            else IF_KEYWORD("scription", 9, YANG_DESCRIPTION)
+            else IF_KEYWORD_PREFIX("viat", 4)
+                IF_KEYWORD("e", 1, YANG_DEVIATE)
+                else IF_KEYWORD("ion", 3, YANG_DEVIATION)
+            IF_KEYWORD_PREFIX_END
+        IF_KEYWORD_PREFIX_END
+        break;
+    case 'e':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("num", 3, YANG_ENUM)
+        else IF_KEYWORD_PREFIX("rror-", 5)
+            IF_KEYWORD("app-tag", 7, YANG_ERROR_APP_TAG)
+            else IF_KEYWORD("message", 7, YANG_ERROR_MESSAGE)
+        IF_KEYWORD_PREFIX_END
+        else IF_KEYWORD("xtension", 8, YANG_EXTENSION)
+        break;
+    case 'f':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("eature", 6, YANG_FEATURE)
+        else IF_KEYWORD("raction-digits", 14, YANG_FRACTION_DIGITS)
+        break;
+    case 'g':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("rouping", 7, YANG_GROUPING)
+        break;
+    case 'i':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("dentity", 7, YANG_IDENTITY)
+        else IF_KEYWORD("f-feature", 9, YANG_IF_FEATURE)
+        else IF_KEYWORD("mport", 5, YANG_IMPORT)
+        else IF_KEYWORD_PREFIX("n", 1)
+            IF_KEYWORD("clude", 5, YANG_INCLUDE)
+            else IF_KEYWORD("put", 3, YANG_INPUT)
+        IF_KEYWORD_PREFIX_END
+        break;
+    case 'k':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("ey", 2, YANG_KEY)
+        break;
+    case 'l':
+        MOVE_IN(data, 1);
+        IF_KEYWORD_PREFIX("e", 1)
+            IF_KEYWORD("af-list", 7, YANG_LEAF_LIST)
+            else IF_KEYWORD("af", 2, YANG_LEAF)
+            else IF_KEYWORD("ngth", 4, YANG_LENGTH)
+        IF_KEYWORD_PREFIX_END
+        else IF_KEYWORD("ist", 3, YANG_LIST)
+        break;
+    case 'm':
+        MOVE_IN(data, 1);
+        IF_KEYWORD_PREFIX("a", 1)
+            IF_KEYWORD("ndatory", 7, YANG_MANDATORY)
+            else IF_KEYWORD("x-elements", 10, YANG_MAX_ELEMENTS)
+        IF_KEYWORD_PREFIX_END
+        else IF_KEYWORD("in-elements", 11, YANG_MIN_ELEMENTS)
+        else IF_KEYWORD("ust", 3, YANG_MUST)
+        else IF_KEYWORD_PREFIX("od", 2)
+            IF_KEYWORD("ule", 3, YANG_MODULE)
+            else IF_KEYWORD("ifier", 5, YANG_MODIFIER)
+        IF_KEYWORD_PREFIX_END
+        break;
+    case 'n':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("amespace", 8, YANG_NAMESPACE)
+        else IF_KEYWORD("otification", 11, YANG_NOTIFICATION)
+        break;
+    case 'o':
+        MOVE_IN(data, 1);
+        IF_KEYWORD_PREFIX("r", 1)
+            IF_KEYWORD("dered-by", 8, YANG_ORDERED_BY)
+            else IF_KEYWORD("ganization", 10, YANG_ORGANIZATION)
+        IF_KEYWORD_PREFIX_END
+        else IF_KEYWORD("utput", 5, YANG_OUTPUT)
+        break;
+    case 'p':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("ath", 3, YANG_PATH)
+        else IF_KEYWORD("attern", 6, YANG_PATTERN)
+        else IF_KEYWORD("osition", 7, YANG_POSITION)
+        else IF_KEYWORD_PREFIX("re", 2)
+            IF_KEYWORD("fix", 3, YANG_PREFIX)
+            else IF_KEYWORD("sence", 5, YANG_PRESENCE)
+        IF_KEYWORD_PREFIX_END
+        break;
+    case 'r':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("ange", 4, YANG_RANGE)
+        else IF_KEYWORD_PREFIX("e", 1)
+            IF_KEYWORD_PREFIX("f", 1)
+                IF_KEYWORD("erence", 6, YANG_REFERENCE)
+                else IF_KEYWORD("ine", 3, YANG_REFINE)
+            IF_KEYWORD_PREFIX_END
+            else IF_KEYWORD("quire-instance", 14, YANG_REQUIRE_INSTANCE)
+            else IF_KEYWORD("vision-date", 11, YANG_REVISION_DATE)
+            else IF_KEYWORD("vision", 6, YANG_REVISION)
+        IF_KEYWORD_PREFIX_END
+        else IF_KEYWORD("pc", 2, YANG_RPC)
+        break;
+    case 's':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("tatus", 5, YANG_STATUS)
+        else IF_KEYWORD("ubmodule", 8, YANG_SUBMODULE)
+        break;
+    case 't':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("ypedef", 6, YANG_TYPEDEF)
+        else IF_KEYWORD("ype", 3, YANG_TYPE)
+        break;
+    case 'u':
+        MOVE_IN(data, 1);
+        IF_KEYWORD_PREFIX("ni", 2)
+            IF_KEYWORD("que", 3, YANG_UNIQUE)
+            else IF_KEYWORD("ts", 2, YANG_UNITS)
+        IF_KEYWORD_PREFIX_END
+        else IF_KEYWORD("ses", 3, YANG_USES)
+        break;
+    case 'v':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("alue", 4, YANG_VALUE)
+        break;
+    case 'w':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("hen", 3, YANG_WHEN)
+        break;
+    case 'y':
+        MOVE_IN(data, 1);
+        IF_KEYWORD("ang-version", 11, YANG_YANG_VERSION)
+        else IF_KEYWORD("in-element", 10, YANG_YIN_ELEMENT)
+        break;
+    case ';':
+        MOVE_IN(data, 1);
+        kw = YANG_SEMICOLON;
+        //goto success;
+        break;
+    case '{':
+        MOVE_IN(data, 1);
+        kw = YANG_LEFT_BRACE;
+        //goto success;
+        break;
+    case '}':
+        MOVE_IN(data, 1);
+        kw = YANG_RIGHT_BRACE;
+        //goto success;
+        break;
+    default:
+        break;
+    }
+
+    /* TODO important fix whole keyword must be matched */
+    return kw;
+}
diff --git a/src/tree_schema_internal.h b/src/tree_schema_internal.h
index b30c123..1a3e078 100644
--- a/src/tree_schema_internal.h
+++ b/src/tree_schema_internal.h
@@ -526,4 +526,8 @@
  */
 LY_ERR yang_parse_module(struct ly_parser_ctx *ctx, const char *data, struct lys_module *mod);
 
+/**
+ * @brief match yang keyword
+ */
+enum yang_keyword match_keyword(const char *data);
 #endif /* LY_TREE_SCHEMA_INTERNAL_H_ */
diff --git a/tests/src/CMakeLists.txt b/tests/src/CMakeLists.txt
index 81753dc..e535650 100644
--- a/tests/src/CMakeLists.txt
+++ b/tests/src/CMakeLists.txt
@@ -5,6 +5,7 @@
     src_hash_table
     src_xml
     src_parser_yang
+    src_parser_yin
     src_tree_schema_compile
     src_tree_schema_helpers)
 set(local_tests_wraps
@@ -15,6 +16,7 @@
     " "
     " "
     " "
+    " "
     " ")
 set(tests ${tests} ${local_tests} PARENT_SCOPE)
 set(tests_wraps ${tests_wraps} ${local_tests_wraps} PARENT_SCOPE)
diff --git a/tests/src/test_parser_yin.c b/tests/src/test_parser_yin.c
new file mode 100644
index 0000000..870e5b4
--- /dev/null
+++ b/tests/src/test_parser_yin.c
@@ -0,0 +1,184 @@
+#include "../../src/common.c"
+#include "../../src/set.c"
+#include "../../src/log.c"
+#include "../../src/hash_table.c"
+#include "../../src/xpath.c"
+#include "../../src/parser_yang.c"
+#include "../../src/context.c"
+#include "../../src/tree_schema_helpers.c"
+#include "../../src/tree_schema_free.c"
+#include "../../src/tree_schema_compile.c"
+#include "../../src/tree_schema.c"
+#include "../../src/xml.c"
+#include "../../src/parser_yin.c"
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <cmocka.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include "libyang.h"
+
+static void
+test_parse(void **state)
+{
+    (void)state; /* unused */
+
+    struct ly_ctx *ctx;
+    struct lysp_module *mod;
+
+    ly_ctx_new(NULL, 0, &ctx);
+    mod = calloc(1, sizeof(*mod));
+    mod->ctx = ctx;
+
+    yin_parse(ctx, "<module name=\"example-foo\"\
+                    xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\"\
+                    xmlns:foo=\"urn:example:foo\"\
+                    xmlns:myext=\"urn:example:extensions\">\
+                    <namespace uri=\"urn:example:foo\"/>\
+                    <prefix value=\"foo\"/>\
+                    \
+                    <import module=\"example-extensions\">\
+                        <prefix value=\"myext\"/>\
+                    </import>\
+                    \
+                    <list name=\"interface\">\
+                        <key value=\"name\"/>\
+                        <leaf name=\"name\">\
+                        <type name=\"string\"/>\
+                        </leaf>\
+                        <leaf name=\"mtu\">\
+                        <type name=\"uint32\"/>\
+                        <description>\
+                            <text>The MTU of the interface.</text>\
+                        </description>\
+                        <myext:c-define name=\"MY_MTU\"/>\
+                        </leaf>\
+                    </list>\
+                    </module>",
+                &mod);
+
+    assert_string_equal(mod->name, "example-foo");
+    assert_string_equal(mod->prefix, "foo");
+
+    lysp_module_free(mod);
+    ly_ctx_destroy(ctx, NULL);
+}
+
+static int
+test_setup(void **state) {
+    (void)state; /* unused */
+    return 0;
+}
+
+static void
+test_match_keyword(void **state)
+{
+    (void)state; /* unused */
+
+    assert_int_equal(match_keyword("anydata"), YANG_ANYDATA);
+    assert_int_equal(match_keyword("asdasd"), YANG_NONE);
+    assert_int_equal(match_keyword(""), YANG_NONE);
+    assert_int_equal(match_keyword("anydata"), YANG_ANYDATA);
+    assert_int_equal(match_keyword("anyxml"), YANG_ANYXML);
+    assert_int_equal(match_keyword("argument"), YANG_ARGUMENT);
+    assert_int_equal(match_keyword("augment"), YANG_AUGMENT);
+    assert_int_equal(match_keyword("base"), YANG_BASE);
+    assert_int_equal(match_keyword("belongs-to"), YANG_BELONGS_TO);
+    assert_int_equal(match_keyword("bit"), YANG_BIT);
+    assert_int_equal(match_keyword("case"), YANG_CASE);
+    assert_int_equal(match_keyword("choice"), YANG_CHOICE);
+    assert_int_equal(match_keyword("config"), YANG_CONFIG);
+    assert_int_equal(match_keyword("contact"), YANG_CONTACT);
+    assert_int_equal(match_keyword("container"), YANG_CONTAINER);
+    assert_int_equal(match_keyword("default"), YANG_DEFAULT);
+    assert_int_equal(match_keyword("description"), YANG_DESCRIPTION);
+    assert_int_equal(match_keyword("deviate"), YANG_DEVIATE);
+    assert_int_equal(match_keyword("deviation"), YANG_DEVIATION);
+    assert_int_equal(match_keyword("enum"), YANG_ENUM);
+    assert_int_equal(match_keyword("error-app-tag"), YANG_ERROR_APP_TAG);
+    assert_int_equal(match_keyword("error-message"), YANG_ERROR_MESSAGE);
+    assert_int_equal(match_keyword("extension"), YANG_EXTENSION);
+    assert_int_equal(match_keyword("feature"), YANG_FEATURE);
+    assert_int_equal(match_keyword("fraction-digits"), YANG_FRACTION_DIGITS);
+    assert_int_equal(match_keyword("grouping"), YANG_GROUPING);
+    assert_int_equal(match_keyword("identity"), YANG_IDENTITY);
+    assert_int_equal(match_keyword("if-feature"), YANG_IF_FEATURE);
+    assert_int_equal(match_keyword("import"), YANG_IMPORT);
+    assert_int_equal(match_keyword("include"), YANG_INCLUDE);
+    assert_int_equal(match_keyword("input"), YANG_INPUT);
+    assert_int_equal(match_keyword("key"), YANG_KEY);
+    assert_int_equal(match_keyword("leaf"), YANG_LEAF);
+    assert_int_equal(match_keyword("leaf-list"), YANG_LEAF_LIST);
+    assert_int_equal(match_keyword("length"), YANG_LENGTH);
+    assert_int_equal(match_keyword("list"), YANG_LIST);
+    assert_int_equal(match_keyword("mandatory"), YANG_MANDATORY);
+    assert_int_equal(match_keyword("max-elements"), YANG_MAX_ELEMENTS);
+    assert_int_equal(match_keyword("min-elements"), YANG_MIN_ELEMENTS);
+    assert_int_equal(match_keyword("modifier"), YANG_MODIFIER);
+    assert_int_equal(match_keyword("module"), YANG_MODULE);
+    assert_int_equal(match_keyword("must"), YANG_MUST);
+    assert_int_equal(match_keyword("namespace"), YANG_NAMESPACE);
+    assert_int_equal(match_keyword("notification"), YANG_NOTIFICATION);
+    assert_int_equal(match_keyword("ordered-by"), YANG_ORDERED_BY);
+    assert_int_equal(match_keyword("organization"), YANG_ORGANIZATION);
+    assert_int_equal(match_keyword("output"), YANG_OUTPUT);
+    assert_int_equal(match_keyword("path"), YANG_PATH);
+    assert_int_equal(match_keyword("pattern"), YANG_PATTERN);
+    assert_int_equal(match_keyword("position"), YANG_POSITION);
+    assert_int_equal(match_keyword("prefix"), YANG_PREFIX);
+    assert_int_equal(match_keyword("presence"), YANG_PRESENCE);
+    assert_int_equal(match_keyword("range"), YANG_RANGE);
+    assert_int_equal(match_keyword("reference"), YANG_REFERENCE);
+    assert_int_equal(match_keyword("refine"), YANG_REFINE);
+    assert_int_equal(match_keyword("require-instance"), YANG_REQUIRE_INSTANCE);
+    assert_int_equal(match_keyword("revision"), YANG_REVISION);
+    assert_int_equal(match_keyword("revision-date"), YANG_REVISION_DATE);
+    assert_int_equal(match_keyword("rpc"), YANG_RPC);
+    assert_int_equal(match_keyword("status"), YANG_STATUS);
+    assert_int_equal(match_keyword("submodule"), YANG_SUBMODULE);
+    assert_int_equal(match_keyword("type"), YANG_TYPE);
+    assert_int_equal(match_keyword("typedef"), YANG_TYPEDEF);
+    assert_int_equal(match_keyword("unique"), YANG_UNIQUE);
+    assert_int_equal(match_keyword("units"), YANG_UNITS);
+    assert_int_equal(match_keyword("uses"), YANG_USES);
+    assert_int_equal(match_keyword("value"), YANG_VALUE);
+    assert_int_equal(match_keyword("when"), YANG_WHEN);
+    assert_int_equal(match_keyword("yang-version"), YANG_YANG_VERSION);
+    assert_int_equal(match_keyword("yin-element"), YANG_YIN_ELEMENT);
+}
+
+static void
+test_match_argument(void **state)
+{
+    (void)state;
+
+    assert_int_equal(match_argument_name("", 5), YIN_ARG_NONE);
+    assert_int_equal(match_argument_name("qwertyasd", 5), YIN_ARG_NONE);
+    assert_int_equal(match_argument_name("conditionasd", 8), YIN_ARG_NONE);
+    assert_int_equal(match_argument_name("condition", 9), YIN_ARG_CONDITION);
+    assert_int_equal(match_argument_name("date", 4), YIN_ARG_DATE);
+    assert_int_equal(match_argument_name("module", 6), YIN_ARG_MODULE);
+    assert_int_equal(match_argument_name("name", 4), YIN_ARG_NAME);
+    assert_int_equal(match_argument_name("tag", 3), YIN_ARG_TAG);
+    assert_int_equal(match_argument_name("target-node", 11), YIN_ARG_TARGET_NODE);
+    assert_int_equal(match_argument_name("text", 4), YIN_ARG_TEXT);
+    assert_int_equal(match_argument_name("uri", 3), YIN_ARG_URI);
+    assert_int_equal(match_argument_name("value", 5), YIN_ARG_VALUE);
+}
+
+int
+main(void)
+{
+
+    const struct CMUnitTest tests[] = {
+        cmocka_unit_test_setup(test_parse, test_setup),
+        cmocka_unit_test(test_match_keyword),
+        cmocka_unit_test(test_match_argument),
+    };
+
+    return cmocka_run_group_tests(tests, NULL, NULL);
+}
