===============
Bool literal #1
===============

rule my_rule {
    condition:
        false   
}

---

(yara_file
    (rule
        (rule_head
            (identifier)    
        )    
        (rule_body
            (bool_literal)    
        )
    )    
)


===============
Bool literal #2
===============

rule my_rule {
    condition:
        true   
}

---

(yara_file
    (rule
        (rule_head
            (identifier)    
        )    
        (rule_body
            (bool_literal)    
        )
    )    
)


==============
String literal
==============

rule my_rule {
    condition:
        "abc\nd"   
}

---

(yara_file
    (rule
        (rule_head
            (identifier)    
        )    
        (rule_body
            (string_literal
                (string_literal_str
                    (string_esc_seq)
                )
            )    
        )
    )    
)


==================
Integer literal #1
==================

rule my_rule {
    condition:
        10
}

---

(yara_file
    (rule
        (rule_head
            (identifier)    
        )    
        (rule_body
            (uint_literal
                (dec_uint_literal_value)
            )    
        )
    )    
)


========================
Integer literal #2 (oct)
========================

rule my_rule {
    condition:
        0o123
}

---

(yara_file
    (rule
        (rule_head
            (identifier)    
        )    
        (rule_body
            (uint_literal
                (oct_uint_literal_value)
            )    
        )
    )    
)


========================
Integer literal #3 (hex)
========================

rule my_rule {
    condition:
        0x134
}

---

(yara_file
    (rule
        (rule_head
            (identifier)    
        )    
        (rule_body
            (uint_literal
                (hex_uint_literal_value)
            )    
        )
    )    
)


=================
Cmd line variable
=================

rule my_rule {
    condition:
        external_variable
}

---

(yara_file
    (rule
        (rule_head
            (identifier)    
        )    
        (rule_body
            (identifier)    
        )
    )    
)


============
String count
============

rule rule123 {
    strings:
        $str = "abc"
    condition:
        #str
}

---

(yara_file
    (rule
        (rule_head
            (identifier)
        )
        (rule_body
            (strings_list
                (string
                    (string_identifier)
                    (string_literal
                        (string_literal_str)
                    )
                )
            )
            (string_count)
        )
    )
)


=============
String offset
=============

rule rule123 {
    strings:
        $str = "abc"
    condition:
        @str
}

---

(yara_file
    (rule
        (rule_head
            (identifier)
        )
        (rule_body
            (strings_list
                (string
                    (string_identifier)
                    (string_literal
                        (string_literal_str)
                    )
                )
            )
            (string_offset)
        )
    )
)


=================
Double literal #1
=================


rule rule123 {
    condition:
        1.0125
}

---

(yara_file
    (rule
        (rule_head
            (identifier)
        )
        (rule_body
            (float_literal)
        )
    )
)


=================
Double literal #2
=================


rule rule123 {
    condition:
        0.0125
}

---

(yara_file
    (rule
        (rule_head
            (identifier)
        )
        (rule_body
            (float_literal)
        )
    )
)
