Elxlog v0.1.5 Read View Source

Read module is input functions of Elxlog.

main function is parse/2 parse/2 recieve string from stdio or file and return listed predicate or clause data {return_val, buffer}

Link to this section Summary

Functions

iex(1)> Read.elixir_name("elx_foo") "foo"

lowercase or number char or underbar iex> Read.is_atom_str("asdf") true iex> Read.is_atom_str("asdf123") true iex> Read.is_atom_str("asdf_abc") true iex> Read.is_atom_str("Asdf") false

iex> Read.is_builtin_str("halt") true iex> Read.is_builtin_str("halz") false

if prefix of str is elx_ it is Elixir function fname iex> Read.is_elixir_func_str("elx_foo") true iex> Read.is_elixir_func_str("foo") false

iex>Read.is_float_str("123") false iex>Read.is_float_str("123.45") true iex>Read.is_float_str("3.0e1") true

atom + - is separated by tokenizer, thus + - is meaningless iex>Read.is_integer_str("123") true iex>Read.is_integer_str("+123") true iex>Read.is_integer_str("-123") true

if head charactor is upper case it is variable if head charactor is underbar it is variable iex> Read.is_var_str("Abc") true iex> Read.is_var_str("abc") false

parse/2 is main function in Read module 1st arg is tokenized list data e.g. ["1","+","2"] 2nd arg is :sidio or file return lited predicate ot clause data {return_val,buffer}

read one unit operator, operand, predicate e.g. :+ 2 [:foo,1,2] 1st arg is tokenized list 2nd arg is streawm :stdio or file

1st arg is tokenized buffer list 2nd arg is return value 3rd arg is stream :stdin or file return {return_val,buffer}

Link to this section Functions

iex(1)> Read.elixir_name("elx_foo") "foo"

lowercase or number char or underbar iex> Read.is_atom_str("asdf") true iex> Read.is_atom_str("asdf123") true iex> Read.is_atom_str("asdf_abc") true iex> Read.is_atom_str("Asdf") false

iex> Read.is_builtin_str("halt") true iex> Read.is_builtin_str("halz") false

if prefix of str is elx_ it is Elixir function fname iex> Read.is_elixir_func_str("elx_foo") true iex> Read.is_elixir_func_str("foo") false

iex>Read.is_float_str("123") false iex>Read.is_float_str("123.45") true iex>Read.is_float_str("3.0e1") true

atom + - is separated by tokenizer, thus + - is meaningless iex>Read.is_integer_str("123") true iex>Read.is_integer_str("+123") true iex>Read.is_integer_str("-123") true

if head charactor is upper case it is variable if head charactor is underbar it is variable iex> Read.is_var_str("Abc") true iex> Read.is_var_str("abc") false

parse/2 is main function in Read module 1st arg is tokenized list data e.g. ["1","+","2"] 2nd arg is :sidio or file return lited predicate ot clause data {return_val,buffer}

Link to this function

parse1(buf, res, stream)

View Source
Link to this function

parse2(list1, list2, buf, stream)

View Source

read one unit operator, operand, predicate e.g. :+ 2 [:foo,1,2] 1st arg is tokenized list 2nd arg is streawm :stdio or file

Link to this function

read_list(x, ls, stream)

View Source

1st arg is tokenized buffer list 2nd arg is return value 3rd arg is stream :stdin or file return {return_val,buffer}

Link to this function

tokenize1(arg1, token, res, stream)

View Source