Skip to content

Instantly share code, notes, and snippets.

@sladyn98
Created June 1, 2019 17:47
Show Gist options
  • Save sladyn98/7570f7da7b4848aa202fab2898934416 to your computer and use it in GitHub Desktop.
Save sladyn98/7570f7da7b4848aa202fab2898934416 to your computer and use it in GitHub Desktop.
Coala CLI Execution
Executing section all...
[WARNING][23:14:11] No files matching '/home/sladyn/Compiler_design/*.py' were found.
Executing section all.invalidlinks...
[WARNING][23:14:12] No files matching '/home/sladyn/Compiler_design/*.py' were found.
[ERROR][23:14:27] The bear InvalidLinkBear does not fulfill all requirements. You are not connected to the internet.
Executing section all.text...
[WARNING][23:14:27] No files matching '/home/sladyn/Compiler_design/*.py' were found.
tokenization/lex.py
| 25| ············tokens.append(["INTEGER",word])·
| | [NORMAL] SpaceConsistencyBear:
| | Line contains following spacing inconsistencies:
| | - Trailing whitespaces.
|----| | /home/sladyn/Compiler_design/tokenization/lex.py
| |++++| /home/sladyn/Compiler_design/tokenization/lex.py
| 22| 22| tokens.append(["IDENTIFIER",word])
| 23| 23|
| 24| 24| elif re.match('[0-9]',word):
| 25| |- tokens.append(["INTEGER",word])
| | 25|+ tokens.append(["INTEGER",word])
| 26| 26|
| 27| 27| elif word in "-/=*":
| 28| 28| tokens.append(["OPERATOR",word])
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Apply patch
| | 3: Print more info
| | 4: Add ignore comment
| | Enter number (Ctrl-D to exit): 2
| | Patch applied successfully.
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Print more info
| | 3: Add ignore comment
| | Enter number (Ctrl-D to exit): 0
tokenization/lex.py
| 26| ········
| | [NORMAL] SpaceConsistencyBear:
| | Line contains following spacing inconsistencies:
| | - Trailing whitespaces.
|----| | /home/sladyn/Compiler_design/tokenization/lex.py
| |++++| /home/sladyn/Compiler_design/tokenization/lex.py
| 23| 23|
| 24| 24| elif re.match('[0-9]',word):
| 25| 25| tokens.append(["INTEGER",word])
| 26| |-
| | 26|+
| 27| 27| elif word in "-/=*":
| 28| 28| tokens.append(["OPERATOR",word])
| 29| 29|
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Apply patch
| | 3: Print more info
| | 4: Add ignore comment
| | Enter number (Ctrl-D to exit): 2
| | Patch applied successfully.
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Print more info
| | 3: Add ignore comment
| | Enter number (Ctrl-D to exit): 0
tokenization/lex.py
| 37| ········
| | [NORMAL] SpaceConsistencyBear:
| | Line contains following spacing inconsistencies:
| | - Trailing whitespaces.
|----| | /home/sladyn/Compiler_design/tokenization/lex.py
| |++++| /home/sladyn/Compiler_design/tokenization/lex.py
| 34| 34| with open('test.txt','r') as file:
| 35| 35| contents = file.read()
| 36| 36| tokenize(contents)
| 37| |-
| | 37|+
| 38| 38| main()
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Apply patch
| | 3: Print more info
| | 4: Add ignore comment
| | Enter number (Ctrl-D to exit): 2
| | Patch applied successfully.
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Print more info
| | 3: Add ignore comment
| | Enter number (Ctrl-D to exit): 0
tokenization/lex.py
| 38| main()
| | [NORMAL] SpaceConsistencyBear:
| | Line contains following spacing inconsistencies:
| | - No newline at EOF.
|----| | /home/sladyn/Compiler_design/tokenization/lex.py
| |++++| /home/sladyn/Compiler_design/tokenization/lex.py
| 35| 35| contents = file.read()
| 36| 36| tokenize(contents)
| 37| 37|
| 38| |-main()
| | 38|+main()
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Apply patch
| | 3: Print more info
| | 4: Add ignore comment
| | Enter number (Ctrl-D to exit): 2
| | Patch applied successfully.
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Print more info
| | 3: Add ignore comment
| | Enter number (Ctrl-D to exit): 0
loop_unroll/loop_unroll.py
| 23| ········"""extract·the·for·loop·statement·and·store·it·in·a·list··"""·······
| | [NORMAL] SpaceConsistencyBear:
| | Line contains following spacing inconsistencies:
| | - Trailing whitespaces.
|----| | /home/sladyn/Compiler_design/loop_unroll/loop_unroll.py
| |++++| /home/sladyn/Compiler_design/loop_unroll/loop_unroll.py
| 20| 20| else:
| 21| 21| tokens.append(["FOR_STATEMENT",word])
| 22| 22|
| 23| |- """extract the for loop statement and store it in a list """
| | 23|+ """extract the for loop statement and store it in a list """
| 24| 24| if "for" in word:
| 25| 25| tokens.append(["FOR_LOOP",word])
| 26| 26| found_for = 1
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Apply patch
| | 3: Print more info
| | 4: Add ignore comment
| | Enter number (Ctrl-D to exit): 2
| | Patch applied successfully.
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Print more info
| | 3: Add ignore comment
| | Enter number (Ctrl-D to exit): 0
loop_unroll/loop_unroll.py
| 37| ·········#extract·the·count·
| | [NORMAL] SpaceConsistencyBear:
| | Line contains following spacing inconsistencies:
| | - Trailing whitespaces.
|----| | /home/sladyn/Compiler_design/loop_unroll/loop_unroll.py
| |++++| /home/sladyn/Compiler_design/loop_unroll/loop_unroll.py
| 34| 34| statement_list = []
| 35| 35|
| 36| 36| for token in tokens:
| 37| |- #extract the count
| | 37|+ #extract the count
| 38| 38| if token[0] == "FOR_LOOP":
| 39| 39| answer = token[1].split(";")
| 40| 40| count = re.split('<|>|=|<=|>=',answer[1])[1]
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Apply patch
| | 3: Print more info
| | 4: Add ignore comment
| | Enter number (Ctrl-D to exit): 2
| | Patch applied successfully.
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Print more info
| | 3: Add ignore comment
| | Enter number (Ctrl-D to exit): 0
loop_unroll/loop_unroll.py
| 55| ····for·line·in·lines:···
| | [NORMAL] SpaceConsistencyBear:
| | Line contains following spacing inconsistencies:
| | - Trailing whitespaces.
|----| | /home/sladyn/Compiler_design/loop_unroll/loop_unroll.py
| |++++| /home/sladyn/Compiler_design/loop_unroll/loop_unroll.py
| 52| 52| lines = file.readlines()
| 53| 53|
| 54| 54| line_no = 0
| 55| |- for line in lines:
| | 55|+ for line in lines:
| 56| 56| if "for" in line:
| 57| 57| for j in range(int(count)):
| 58| 58| """writes statements as they are in statement list"""
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Apply patch
| | 3: Print more info
| | 4: Add ignore comment
| | Enter number (Ctrl-D to exit): 2
| | Patch applied successfully.
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Print more info
| | 3: Add ignore comment
| | Enter number (Ctrl-D to exit): 0
loop_unroll/loop_unroll.py
| 65| ······
| | [NORMAL] SpaceConsistencyBear:
| | Line contains following spacing inconsistencies:
| | - Trailing whitespaces.
|----| | /home/sladyn/Compiler_design/loop_unroll/loop_unroll.py
| |++++| /home/sladyn/Compiler_design/loop_unroll/loop_unroll.py
| 62| 62| last_line_no = line_no
| 63| 63| j=j+1
| 64| 64| line_no+=1
| 65| |-
| | 65|+
| 66| 66| lines[last_line_no+1] = "}"
| 67| 67|
| 68| 68| with open('code_opt.c','w') as file:
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Apply patch
| | 3: Print more info
| | 4: Add ignore comment
| | Enter number (Ctrl-D to exit): 2
| | Patch applied successfully.
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Print more info
| | 3: Add ignore comment
| | Enter number (Ctrl-D to exit): 0
loop_unroll/loop_unroll.py
| 81| main()
| | [NORMAL] SpaceConsistencyBear:
| | Line contains following spacing inconsistencies:
| | - No newline at EOF.
|----| | /home/sladyn/Compiler_design/loop_unroll/loop_unroll.py
| |++++| /home/sladyn/Compiler_design/loop_unroll/loop_unroll.py
| 78| 78| tokenize(lines)
| 79| 79|
| 80| 80|
| 81| |-main()
| | 81|+main()
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Apply patch
| | 3: Print more info
| | 4: Add ignore comment
| | Enter number (Ctrl-D to exit): 2
| | Patch applied successfully.
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Print more info
| | 3: Add ignore comment
| | Enter number (Ctrl-D to exit): 0
cse/cse.py
| 29| ····
| | [NORMAL] SpaceConsistencyBear:
| | Line contains following spacing inconsistencies:
| | - Trailing whitespaces.
|----| | /home/sladyn/Compiler_design/cse/cse.py
| |++++| /home/sladyn/Compiler_design/cse/cse.py
| 26| 26| code_list.remove(values)
| 27| 27| replace_dict[values[0]] = rhs[0]
| 28| 28| break
| 29| |-
| | 29|+
| 30| 30| replace_sub_expression(code_list,replace_dict)
| 31| 31|
| 32| 32| """replace the repeating expression with its first occurence"""
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Apply patch
| | 3: Print more info
| | 4: Add ignore comment
| | Enter number (Ctrl-D to exit): 2
| | Patch applied successfully.
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Print more info
| | 3: Add ignore comment
| | Enter number (Ctrl-D to exit): 0
cse/cse.py
| 70| main()
| | [NORMAL] SpaceConsistencyBear:
| | Line contains following spacing inconsistencies:
| | - No newline at EOF.
|----| | /home/sladyn/Compiler_design/cse/cse.py
| |++++| /home/sladyn/Compiler_design/cse/cse.py
| 67| 67|
| 68| 68| tokenize(lines)
| 69| 69|
| 70| |-main()
| | 70|+main()
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Apply patch
| | 3: Print more info
| | 4: Add ignore comment
| | Enter number (Ctrl-D to exit): 2
| | Patch applied successfully.
| | *0: Do nothing
| | 1: Open file(s)
| | 2: Print more info
| | 3: Add ignore comment
| | Enter number (Ctrl-D to exit): 0
Executing section all.markdown...
[WARNING][23:15:12] No files matching '/home/sladyn/Compiler_design/*.py' were found.
[ERROR][23:15:12] The bear MarkdownBear does not fulfill all requirements. 'remark' is not installed.
Executing section all.whitespace...
[WARNING][23:15:12] No files matching '/home/sladyn/Compiler_design/*.py' were found.
Executing section cli...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment