Commit 3e7cb904 authored by 0xJMR's avatar 0xJMR
Browse files

Fixes issue with transposition.

parent 2e112a7e
Pipeline #58807 passed with stages
in 47 seconds
......@@ -6,8 +6,6 @@ import de.monticore.commonexpressions._ast.ASTMultExpression;
import de.monticore.lang.math._ast.*;
import de.monticore.lang.matrix._ast.ASTMathMatrixAccessExpression;
import de.monticore.lang.matrix._ast.ASTMathMatrixValueExplicitExpression;
import de.monticore.lang.matrix._ast.ASTMathVectorExpression;
import de.monticore.lang.matrixexpressions._ast.ASTMathArithmeticMatrixEELeftDivideExpression;
import de.monticore.lang.matrixexpressions._ast.ASTMathArithmeticMatrixEEPowExpression;
import de.monticore.lang.matrixexpressions._ast.ASTMathArithmeticMatrixSolutionExpression;
import de.monticore.numberunit._ast.ASTTimeDiv;
......@@ -131,21 +129,6 @@ public class TeXMathPrettyPrinter extends MathPrettyPrinter implements TeXMathSt
this.printer.print("~\\%~");
}
@Override
public void visit(ASTMathVectorExpression node) {
this.printer.print("\\begin{bmatrix}");
}
@Override
public void revisit(ASTMathVectorExpression node) {
this.printer.print("\\\\");
}
@Override
public void endVisit(ASTMathVectorExpression node) {
this.printer.print("\\end{bmatrix}");
}
@Override
public void revisit(ASTMathArithmeticMatrixSolutionExpression node) {
this.printer.print("~.\\backslash\\backslash~");
......
package de.monticore.lang.monticar.mpp.montimath;
import de.monticore.expressionsbasis._ast.ASTExpression;
import de.monticore.lang.math._ast.ASTDimension;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public interface TeXMathStructuredVisitor extends MathStructuredVisitor {
@Override
default void traverse(ASTDimension node) {
List<ASTExpression> clonedNodes = new ArrayList<>(node.getMatrixDimList());
Collections.reverse(clonedNodes);
Iterator iter_matrixDims = clonedNodes.iterator();
while(iter_matrixDims.hasNext()) {
((ASTExpression)iter_matrixDims.next()).accept(this.getRealThis());
if (iter_matrixDims.hasNext()) this.getRealThis().revisit(node);
}
if (node.getVecDimOpt().isPresent()) {
((ASTExpression)node.getVecDimOpt().get()).accept(this.getRealThis());
if (iter_matrixDims.hasNext()) this.getRealThis().revisit(node);
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment