Skip to content

Commit

Permalink
Rename lfortran folder to lpython
Browse files Browse the repository at this point in the history
  • Loading branch information
Thirumalai-Shaktivel committed Jan 19, 2022
1 parent 0f3c870 commit a0cbcdb
Show file tree
Hide file tree
Showing 69 changed files with 200 additions and 200 deletions.
70 changes: 35 additions & 35 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ src/bin/lpython
src/bin/cpptranslate
src/bin/parse
src/bin/parse2
src/lfortran/parser/parser.output
src/lpython/parser/parser.output
tests/output
src/lfortran/tests/test_asm
src/lfortran/tests/test_ast
src/lfortran/tests/test_llvm
src/lfortran/tests/test_parse
src/lfortran/tests/test_pickle
src/lfortran/tests/test_stacktrace*
src/lfortran/tests/test_serialization*
src/lfortran/tests/test_cwrapper
src/lfortran/tests/test_serialization
src/lfortran/tests/test_lfortran
src/lfortran/tests/write32
src/lfortran/tests/write32.asm
src/lfortran/tests/subroutines32
src/lfortran/tests/subroutines_args32
src/lfortran/tests/print32
src/lfortran/tests/print_integer
src/lfortran/tests/cmp32
src/lfortran/tests/x
src/lfortran/tests/ref_pickle.txt.new
src/lpython/tests/test_asm
src/lpython/tests/test_ast
src/lpython/tests/test_llvm
src/lpython/tests/test_parse
src/lpython/tests/test_pickle
src/lpython/tests/test_stacktrace
src/lpython/tests/test_serialization
src/lpython/tests/test_cwrapper
src/lpython/tests/test_serialization
src/lpython/tests/test_lfortran
src/lpython/tests/write32
src/lpython/tests/write32.asm
src/lpython/tests/subroutines32
src/lpython/tests/subroutines_args32
src/lpython/tests/print32
src/lpython/tests/print_integer
src/lpython/tests/cmp32
src/lpython/tests/x
src/lpython/tests/ref_pickle.txt.new

# fortran_parser

Expand Down Expand Up @@ -54,21 +54,21 @@ _CPack_Packages

## Generated files
version
lfortran/ast/ast.py
lfortran/asr/asr.py
lfortran/parser/fortran.tokens
lfortran/parser/fortran.interp
lfortran/parser/fortranLexer.py
lfortran/parser/fortranLexer.tokens
lfortran/parser/fortranLexer.interp
lfortran/parser/fortranParser.py
lfortran/parser/fortranVisitor.py
src/lfortran/parser/parser.tab.cc
src/lfortran/parser/parser.tab.hh
src/lfortran/parser/tokenizer.cpp
src/lfortran/parser/preprocessor.cpp
src/lfortran/ast.h
src/lfortran/asr.h
lpython/ast/ast.py
lpython/asr/asr.py
lpython/parser/fortran.tokens
lpython/parser/fortran.interp
lpython/parser/fortranLexer.py
lpython/parser/fortranLexer.tokens
lpython/parser/fortranLexer.interp
lpython/parser/fortranParser.py
lpython/parser/fortranVisitor.py
src/lpython/parser/parser.tab.cc
src/lpython/parser/parser.tab.hh
src/lpython/parser/tokenizer.cpp
src/lpython/parser/preprocessor.cpp
src/lpython/ast.h
src/lpython/asr.h
src/libasr/asr.h
src/libasr/config.h
share/jupyter/kernels/fortran/kernel.json
Expand Down
10 changes: 5 additions & 5 deletions build0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ python grammar/asdl_cpp.py
# Generate a Python AST from Python.asdl (Python)
python grammar/asdl_py.py
# Generate a Python AST from Python.asdl (C++)
python grammar/asdl_cpp.py grammar/Python.asdl src/lfortran/python_ast.h
python grammar/asdl_cpp.py grammar/Python.asdl src/lpython/python_ast.h
# Generate a Fortran ASR from ASR.asdl (C++)
python grammar/asdl_cpp.py grammar/ASR.asdl src/libasr/asr.h

# Generate the tokenizer and parser
(cd src/lfortran/parser && re2c -W -b tokenizer.re -o tokenizer.cpp)
(cd src/lfortran/parser && re2c -W -b preprocessor.re -o preprocessor.cpp)
(cd src/lfortran/parser && bison -Wall -d -r all parser.yy)
(cd src/lpython/parser && re2c -W -b tokenizer.re -o tokenizer.cpp)
(cd src/lpython/parser && re2c -W -b preprocessor.re -o preprocessor.cpp)
(cd src/lpython/parser && bison -Wall -d -r all parser.yy)

grep -n "'" src/lfortran/parser/parser.yy && echo "Single quote not allowed" && exit 1
grep -n "'" src/lpython/parser/parser.yy && echo "Single quote not allowed" && exit 1
echo "OK"
6 changes: 3 additions & 3 deletions build1_win.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
bash ci/version.sh
python grammar/asdl_cpp.py
python grammar/asdl_cpp.py grammar/ASR.asdl src/libasr/asr.h
pushd src/lfortran/parser && re2c -W -b tokenizer.re -o tokenizer.cpp && popd
pushd src/lfortran/parser && re2c -W -b preprocessor.re -o preprocessor.cpp && popd
pushd src/lfortran/parser && bison -Wall -d -r all parser.yy && popd
pushd src/lpython/parser && re2c -W -b tokenizer.re -o tokenizer.cpp && popd
pushd src/lpython/parser && re2c -W -b preprocessor.re -o preprocessor.cpp && popd
pushd src/lpython/parser && bison -Wall -d -r all parser.yy && popd
12 changes: 6 additions & 6 deletions ci/build.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ python grammar/asdl_cpp.py
# Generate a Fortran ASR from ASR.asdl (C++)
python grammar/asdl_cpp.py grammar/ASR.asdl src/libasr/asr.h
# Generate a Python AST from Python.asdl (C++)
python grammar/asdl_cpp.py grammar/Python.asdl src/lfortran/python_ast.h
python grammar/asdl_cpp.py grammar/Python.asdl src/lpython/python_ast.h
# Generate a Python AST from Python.asdl (Python)
python grammar/asdl_py.py

# Generate the tokenizer and parser
pushd src/lfortran/parser && re2c -W -b tokenizer.re -o tokenizer.cpp && popd
pushd src/lfortran/parser && re2c -W -b preprocessor.re -o preprocessor.cpp && popd
pushd src/lfortran/parser && bison -Wall -d -r all parser.yy && popd
pushd src/lpython/parser && re2c -W -b tokenizer.re -o tokenizer.cpp && popd
pushd src/lpython/parser && re2c -W -b preprocessor.re -o preprocessor.cpp && popd
pushd src/lpython/parser && bison -Wall -d -r all parser.yy && popd

$lpython_version=$(cat version).strip()
$dest="lpython-" + $lpython_version
Expand All @@ -54,7 +54,7 @@ cd test-bld
BUILD_TYPE = "Release"
cmake -G $LFORTRAN_CMAKE_GENERATOR -DCMAKE_VERBOSE_MAKEFILE=ON -DWITH_LLVM=yes -DWITH_XEUS=yes -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DWITH_LFORTRAN_BINARY_MODFILES=no -DCMAKE_BUILD_TYPE=@(BUILD_TYPE) ..
cmake --build . --target install
./src/lfortran/tests/test_lfortran
./src/lpython/tests/test_lfortran
./src/bin/lpython < ../src/bin/example_input.txt
ctest --output-on-failure
cpack -V
Expand All @@ -63,7 +63,7 @@ cd ../..
jupyter kernelspec list --json
#python ci/test_fortran_kernel.py -v
#
cd share/lfortran/nb
cd share/lpython/nb
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=60 --output Demo1_out.ipynb Demo1.ipynb
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=60 --output Demo2_out.ipynb Demo2.ipynb
cat Demo1_out.ipynb
Expand Down
2 changes: 1 addition & 1 deletion grammar/asdl_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ def main(argv):
print("Assuming default values of AST.asdl and ast.h")
here = os.path.dirname(__file__)
def_file = os.path.join(here, "AST.asdl")
out_file = os.path.join(here, "..", "src", "lfortran", "ast.h")
out_file = os.path.join(here, "..", "src", "lpython", "ast.h")
else:
print("invalid arguments")
return 2
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_subdirectory(libasr)
add_subdirectory(tests)
add_subdirectory(lfortran)
add_subdirectory(lpython)
add_subdirectory(bin)
add_subdirectory(runtime/legacy)
6 changes: 3 additions & 3 deletions src/bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if (WITH_RUNTIME_LIBRARY)
${CMAKE_CURRENT_BINARY_DIR}/../runtime/lfortran_intrinsic_sin.mod
${CMAKE_CURRENT_BINARY_DIR}/../runtime/lfortran_intrinsic_string.mod
${CMAKE_CURRENT_BINARY_DIR}/../runtime/lfortran_intrinsic_bit.mod
DESTINATION share/lfortran/lib
DESTINATION share/lpython/lib
)
endif()

Expand All @@ -127,8 +127,8 @@ set_target_properties(lpython PROPERTIES

install(TARGETS lpython
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION share/lfortran/lib
LIBRARY DESTINATION share/lfortran/lib
ARCHIVE DESTINATION share/lpython/lib
LIBRARY DESTINATION share/lpython/lib
)


Expand Down
10 changes: 5 additions & 5 deletions src/bin/cpptranslate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#define CLI11_HAS_FILESYSTEM 0
#include <bin/CLI11.hpp>

#include <lfortran/parser/parser.h>
#include <lfortran/pickle.h>
#include <lfortran/semantics/ast_to_asr.h>
#include <lfortran/ast_to_src.h>
#include <lfortran/ast_to_openmp.h>
#include <lpython/parser/parser.h>
#include <lpython/pickle.h>
#include <lpython/semantics/ast_to_asr.h>
#include <lpython/ast_to_src.h>
#include <lpython/ast_to_openmp.h>
#include <libasr/config.h>

std::string read_file(const std::string &filename)
Expand Down
24 changes: 12 additions & 12 deletions src/bin/lfortran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
#include <bin/CLI11.hpp>

#include <libasr/stacktrace.h>
#include <lfortran/parser/parser.h>
#include <lfortran/parser/preprocessor.h>
#include <lfortran/pickle.h>
#include <lfortran/semantics/ast_to_asr.h>
#include <lfortran/semantics/python_ast_to_asr.h>
#include <lfortran/mod_to_asr.h>
#include <lpython/parser/parser.h>
#include <lpython/parser/preprocessor.h>
#include <lpython/pickle.h>
#include <lpython/semantics/ast_to_asr.h>
#include <lpython/semantics/python_ast_to_asr.h>
#include <lpython/mod_to_asr.h>
#include <libasr/codegen/asr_to_llvm.h>
#include <libasr/codegen/asr_to_cpp.h>
#include <libasr/codegen/asr_to_py.h>
#include <libasr/codegen/asr_to_x86.h>
#include <lfortran/ast_to_src.h>
#include <lfortran/fortran_evaluator.h>
#include <lpython/ast_to_src.h>
#include <lpython/fortran_evaluator.h>
#include <libasr/codegen/evaluator.h>
#include <libasr/pass/do_loops.h>
#include <libasr/pass/for_all.h>
Expand All @@ -33,11 +33,11 @@
#include <libasr/asr_verify.h>
#include <libasr/modfile.h>
#include <libasr/config.h>
#include <lfortran/fortran_kernel.h>
#include <lpython/fortran_kernel.h>
#include <libasr/string_utils.h>
#include <lfortran/utils.h>
#include <lfortran/python_serialization.h>
#include <lfortran/parser/parser.tab.hh>
#include <lpython/utils.h>
#include <lpython/python_serialization.h>
#include <lpython/parser/parser.tab.hh>

#include <cpp-terminal/terminal.h>
#include <cpp-terminal/prompt0.h>
Expand Down
2 changes: 1 addition & 1 deletion src/bin/parse.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <iostream>
#include <chrono>
#include <lfortran/parser/parser.h>
#include <lpython/parser/parser.h>

using LFortran::parse;
using LFortran::AST::ast_t;
Expand Down
4 changes: 2 additions & 2 deletions src/bin/parse2.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <iostream>
#include <fstream>
#include <chrono>
#include <lfortran/parser/parser.h>
#include <lfortran/pickle.h>
#include <lpython/parser/parser.h>
#include <lpython/pickle.h>

int main()
{
Expand Down
4 changes: 2 additions & 2 deletions src/bin/parse3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include <fmt/core.h>

#include <lfortran/parser/parser.h>
#include <lfortran/pickle.h>
#include <lpython/parser/parser.h>
#include <lpython/pickle.h>

std::string construct_fortran(size_t N) {
std::string sub_template = R"(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <string>

#include <libasr/config.h>
#include <lfortran/ast_serialization.h>
#include <lfortran/parser/parser.h>
#include <lfortran/parser/parser.tab.hh>
#include <lpython/ast_serialization.h>
#include <lpython/parser/parser.h>
#include <lpython/parser/parser.tab.hh>
#include <libasr/asr_utils.h>
#include <libasr/asr_verify.h>
#include <libasr/bwriter.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef LFORTRAN_SERIALIZATION_H
#define LFORTRAN_SERIALIZATION_H

#include <lfortran/ast.h>
#include <lpython/ast.h>
#include <libasr/asr.h>

namespace LFortran {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <rapidjson/writer.h>
#include <rapidjson/stringbuffer.h>

#include <lfortran/ast_to_json.h>
#include <lpython/ast_to_json.h>

using LFortran::AST::expr_t;
using LFortran::AST::Name_t;
Expand Down
2 changes: 1 addition & 1 deletion src/lfortran/ast_to_json.h → src/lpython/ast_to_json.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef LFORTRAN_AST_TO_JSON_H
#define LFORTRAN_AST_TO_JSON_H

#include <lfortran/ast.h>
#include <lpython/ast.h>

namespace LFortran {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <cctype>

#include <lfortran/ast_to_openmp.h>
#include <lpython/ast_to_openmp.h>

using LFortran::AST::expr_t;
using LFortran::AST::Name_t;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef LFORTRAN_AST_TO_OPENMP_H
#define LFORTRAN_AST_TO_OPENMP_H

#include <lfortran/ast.h>
#include <lpython/ast.h>

namespace LFortran {

Expand Down
4 changes: 2 additions & 2 deletions src/lfortran/ast_to_src.cpp → src/lpython/ast_to_src.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <cctype>
#include <lfortran/ast_to_src.h>
#include <lpython/ast_to_src.h>
#include <libasr/string_utils.h>
#include <lfortran/bigint.h>
#include <lpython/bigint.h>

using LFortran::AST::expr_t;
using LFortran::AST::Name_t;
Expand Down
2 changes: 1 addition & 1 deletion src/lfortran/ast_to_src.h → src/lpython/ast_to_src.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef LFORTRAN_AST_TO_SRC_H
#define LFORTRAN_AST_TO_SRC_H

#include <lfortran/ast.h>
#include <lpython/ast.h>

namespace LFortran {

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/lfortran/cwrapper.cpp → src/lpython/cwrapper.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <cstdlib>
#include <cstring>

#include <lfortran/cwrapper.h>
#include <lfortran/ast.h>
#include <lpython/cwrapper.h>
#include <lpython/ast.h>
#include <libasr/alloc.h>
#include <lfortran/parser/parser.h>
#include <lfortran/pickle.h>
#include <lpython/parser/parser.h>
#include <lpython/pickle.h>


extern "C" {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include <iostream>
#include <fstream>

#include <lfortran/fortran_evaluator.h>
#include <lpython/fortran_evaluator.h>
#include <libasr/codegen/asr_to_cpp.h>
#include <lfortran/ast_to_src.h>
#include <lpython/ast_to_src.h>
#include <libasr/exception.h>
#include <lfortran/ast.h>
#include <lpython/ast.h>
#include <libasr/asr.h>
#include <lfortran/semantics/ast_to_asr.h>
#include <lfortran/parser/parser.h>
#include <lfortran/parser/preprocessor.h>
#include <lfortran/pickle.h>
#include <lpython/semantics/ast_to_asr.h>
#include <lpython/parser/parser.h>
#include <lpython/parser/preprocessor.h>
#include <lpython/pickle.h>

#ifdef HAVE_LFORTRAN_LLVM
#include <libasr/codegen/evaluator.h>
Expand Down
Loading

0 comments on commit a0cbcdb

Please sign in to comment.